Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1703846lqp; Mon, 15 Apr 2024 14:40:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX8tObFIx2HQPwxL6DVBUvrwYe34rxfi7s6hjTbUiJeOq58tDhZM+kQpLKJaShW0Brg5poFqUvb5RA4NHtnywZixo5r8wXkJpPxR/UgNA== X-Google-Smtp-Source: AGHT+IHypFkPzhkPKOxenLAASkg8cooUyOFqCZS0YZA0KxDJRncl2oAqkJUXsk/Oh0ctnIqd2pkV X-Received: by 2002:a05:6a20:3c9e:b0:1a8:2cd1:e437 with SMTP id b30-20020a056a203c9e00b001a82cd1e437mr10952499pzj.11.1713217240665; Mon, 15 Apr 2024 14:40:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713217240; cv=pass; d=google.com; s=arc-20160816; b=e8dZgBdIKWBf/ajA7y1kRcdIIU/Ha05I0vYTHRKNmVZyGJBbObiN6kh6waJlQE/buP 6ALJvx1yj0C/WqohaK/Z9lVBR2p85J1ZjKDd56wM8AH1XDftmzkYQGXIQRQIv6LI9BJz 32i+8HID438CM6dcc3BMgKHuQLcncjq69L3ggIly5OrLFY+iqVJdkeypdaV5dGcs5r/n QSgHNzPErai5YRIWGrqjGSqm7cu24unm1RGcSaZ5yelxay/cMgF5CsnLFFTlGL2Li73W 0ftyrg756sHPUh8ysgA62tRknTemgsm5m4iSDhzYtRj+3NfmwJec8XqnoVgIqU+g4vI9 TWZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/977XF450qHmv2j9UFaC1yJdhw/c//gt9/Z+iM6A9NU=; fh=+xbBfZzfQ2dxivXPB50036783qQwkH8CTRdxd0/nsGc=; b=krOIZldHKkEP7qqKIxIDdqTXMKzNOAG1FNQH/spVJKiQbc7L54A8SniAIjMxekBYfs IuCwDf0pDg2OPSh+4gt582JW2OB7taUfZOpssucLyVjSVEqLfJKjDLVfL5fgFLI1bs4A tdO1h76I7SjHLjniy/BtzdkqbYCzFtJ0dGUkW4orWD4Fd3uUOXgUKWIycg8ZAsKDRxB0 WzWf2hCl8buSgCwTapIzohRL3sXOONi8f4HdrcKfAGVbTXrWD5Ed36bIfYjoiqanho4O DomsHr8BSgBTm3dusC07QG6AdnkEVYRKq0vFBR6h1Yrd9SEa0hULA3MGTMexxuS81A6J umjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hN8+J4+u; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-145939-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145939-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z127-20020a626585000000b006eabb98a961si8629283pfb.207.2024.04.15.14.40.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 14:40:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145939-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hN8+J4+u; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-145939-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145939-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 79530B227B8 for ; Mon, 15 Apr 2024 21:38:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3ABAB15746D; Mon, 15 Apr 2024 21:37:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hN8+J4+u" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 652E71E89A for ; Mon, 15 Apr 2024 21:37:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713217073; cv=none; b=T9kxCMMGeuxDKvyaXLD9HmsHJxU6qxHz0Ckimb4HLGjfjTlCzsPJvLFY+9oNZvYWRVPqZJBqGCsh1jL4YCRC5sjgPkqGOUo9P3Ik+NsCcj1zdD68Xl2SeIgGERwPwP1uCEi1gG7g/C/0XVLIEGM+aEFXsOsnUJLs0BphfR9+iJk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713217073; c=relaxed/simple; bh=LrNCRf6AYFBg2yEZSaZLlRRszF2n2/fBOUmVb5nWeIo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Exn0fm4JdYlrSPABm6P/nOkb38ClXlh0OsRP5sF5NuNDoiL0JgwVkvS/toV4j93+SjAdmM+T3m3ZhYKyPIrzmIw3McE17VMjn5P2t9MkFunvSmhhTfBZuMBnNm1NkF9GJ9ryatJ4vN/kpidmEL1YGSk1LSAmRuWhh8ALd1RziyA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hN8+J4+u; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 743AEC113CC; Mon, 15 Apr 2024 21:37:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713217072; bh=LrNCRf6AYFBg2yEZSaZLlRRszF2n2/fBOUmVb5nWeIo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hN8+J4+uU09Pyr4W6pLQ8ysqdXa2y6fhx/oeZtqJuxs4g8kAVtNIJBf/ZA0whEE4h cs8861e8+MdxnPvbNf+QZG/VCEKZbp1wena+Dv0TRysKVBKMeoBKlTXRJN86thSh0m 23fkZHirRXvv0wKPpmCvbtEF5CSG4xfix1IBJRJkXEYkpl/ploY8Sz/TLUHFced3hk w8SMgidI7tZZL5VNwZ7WEZy+ZcX+oYViqQMHQy9N7KelSVxfFgiRzLSDborqpTg7ML A9B2lGWZvK43kTglk4Eh2VV589MNYO9WP/dCVvpXW+uvlU8tgS/k3dqhL6NwvZCd/f ONssDyobeXIaQ== Date: Mon, 15 Apr 2024 23:37:49 +0200 From: Frederic Weisbecker To: Oleg Nesterov Cc: Nicholas Piggin , Leonardo Bras , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Tejun Heo , Lai Jiangshan , linux-kernel@vger.kernel.org, Junyao Zhao , Chris von Recklinghausen Subject: Re: [PATCH] sched/isolation: fix boot crash when the boot CPU is nohz_full Message-ID: References: <20240130010046.2730139-2-leobras@redhat.com> <20240402105847.GA24832@redhat.com> <20240411143905.GA19288@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240411143905.GA19288@redhat.com> Le Thu, Apr 11, 2024 at 04:39:05PM +0200, Oleg Nesterov a ?crit : > Documentation/timers/no_hz.rst states that the "nohz_full=" mask must not > include the boot CPU, this is no longer true after the commit 08ae95f4fd3b > ("nohz_full: Allow the boot CPU to be nohz_full"). > > However after another commit aae17ebb53cd ("workqueue: Avoid using isolated > cpus' timers on queue_delayed_work") the kernel will crash at boot time in > this case; housekeeping_any_cpu() returns an invalid cpu nr until smp_init() > paths bring the 1st housekeeping CPU up. > > Change housekeeping_any_cpu() to check the result of cpumask_any_and() and > return smp_processor_id() in this case. Yes, this is just the simple and > backportable workaround which fixes the symptom, but smp_processor_id() at > boot time should be safe at least for type == HK_TYPE_TIMER, this more or > less matches the tick_do_timer_boot_cpu logic. > > We should not worry about cpu_down(); tick_nohz_cpu_down() will not allow > to offline tick_do_timer_cpu (the 1st online housekeeping CPU). > > Fixes: aae17ebb53cd ("workqueue: Avoid using isolated cpus' timers on queue_delayed_work") > Reported-by: Chris von Recklinghausen > Closes: https://lore.kernel.org/all/20240402105847.GA24832@redhat.com/ > Signed-off-by: Oleg Nesterov Acked-by: Frederic Weisbecker