Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1997062lqe; Tue, 9 Apr 2024 07:00:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUkqGVJ/qRJXb14xwCCVI1tSp8TIv2tLL8kOEPiIVrLBEMlcHyuq64AaOdfZhwU9AR7+Y0MHX8Kb9XNU0IlkZEtLjJT6zzIY81PZeLm4g== X-Google-Smtp-Source: AGHT+IGq0pJqx14XCta0k7Dvb/HXoEt2lp+PyT8A9YsOfNksd++BG8+R0DjOWvfnxBjwXdObfhfA X-Received: by 2002:ac2:5f87:0:b0:515:d1c8:e486 with SMTP id r7-20020ac25f87000000b00515d1c8e486mr8520831lfe.35.1712671210980; Tue, 09 Apr 2024 07:00:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712671210; cv=pass; d=google.com; s=arc-20160816; b=vBbQjkOyPVpF5Ix6/EqBxLIkGYoZY53F0BI4lDInMLolaYe+uARPomMgAtfymZ2X/p L2/hcfLvhiVpaabU/c2/C+S+DcUthUG9C9WxqTKht5IWRLX40jCMeiT9cn4CjlE9jFjl DSLa0mkFJiZONGRqXBCKNRHV3Js9Pd3/hatNCus2F0Rt5pHG3gBXwJYvMNr7ZvPgFGHW bNpdeqA1SDqzaUaykvQWhZxagjKRqAPZUD/2sbIKLX15tUYIv0VByci/9V4OK0Gy7wu9 ZGmltiyQJJ6J+FSX+hYi4kBdu77X+s5BmT92eU5o5c3LqsKcRufQ1heCl9NotOKMcLxK X+Ng== 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=55oBihYWI3i6ImNTkI/SIhrWc5j7Ml4vHl6BFAaJf3M=; fh=axw0gJo1hzSCsiw20SnFx8p1q7RioSE7NHheGvxOrNg=; b=yBnfgi+3zKwVtbsEWA4LKWYLFJHG/eEM5pZ7PtlWBSw6C5tGBm807tgXqZDbDvkOvB ppMfo2RAMdCTGYrmERD4NbkCyT00EF1DPh3fGa2xzMHlSsPTTxLw6BvPWha8kc75fjYu 8EXDzqKzU0DcoEgJhePUS6L8nNYrfLJMeZNovd2SQC62ELrjeETVMxZDP3l+MSW2AT3B 9D6dNBZeUAUPGeY4v17EfAY9pa2R3omPhsREH6nV02Z7Gr/PP8W42UnDr2Iu6sHUaBQy DHYyO8UXQyIQieNBymChhF4VfEWp2RRcmEhQ//s/YMqKE6yuRsK9ToopQ+z43NPUdaHA LDpQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vPHm5Ewx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-137039-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137039-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ss2-20020a170907038200b00a46e6d3a27esi4596020ejb.527.2024.04.09.07.00.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 07:00:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137039-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vPHm5Ewx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-137039-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137039-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 am.mirrors.kernel.org (Postfix) with ESMTPS id AEB6D1F22CFF for ; Tue, 9 Apr 2024 14:00:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1DF2512F591; Tue, 9 Apr 2024 14:00:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vPHm5Ewx" 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 491927BAF3 for ; Tue, 9 Apr 2024 14:00:03 +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=1712671203; cv=none; b=q3X3LCcnQQenuzNU/nBt+3BkAJ+9cMvC8q8twYICWJoz1eYp2ReeJ1EMVEHr1qOo9nB8NKk40YkZoUXXPyugKJwA/B4iblErhuuYQBkU9ZLv5oYyK5wzFIfmZqsyI6DVkwKcRzUJmJFWFwJQq47YS34Odzt51P6JjMtNPkUDSLw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712671203; c=relaxed/simple; bh=YE4SM/AVhmsY36Btdoby6ScHukpiWOmm9uQ9kMEx29U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qni4VGqh4UulkkpjR9xCRJw49ENtwPhSiNMTMuTE+ImQBQGAy092DPGoWAtR71c8JtdpS6pmp0ivJ+GOQC92LPMfuc2MyJ790SX51HBBObsGmEHdAxbRTjmU0C6qyrVLBmEwlqkqe8Ae3Yb7gov2CuXZclo/2ginmGG24l0o1yU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vPHm5Ewx; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 659FCC433C7; Tue, 9 Apr 2024 14:00:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712671202; bh=YE4SM/AVhmsY36Btdoby6ScHukpiWOmm9uQ9kMEx29U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vPHm5EwxD7YwzQa3dG/UpYUMVfcQDAwIhuehSGcFJGZsa6pMlM1F/ayuE+bnSe5vE 9E/zoVPC1AqSuzPgX0DTw2tN2S4I7yWpGpXPx5WS7xq6HoE7smdtqhskUvIbGEa8Dh KmDDUv1+py1z6zbGnNyjHAU/juuHaXbKz0c/tzQy6wibUsodJSl8+nstLtXml+qbkl GuClRqZfkWqo2OU2CX/onjfdhIwKOxat8X798FAZeoJLPW4ZBrV8r2GtVJ+oXqrGIT Vl0uz90tjSabXIkqEe+aymUKRFuBgvnUMy07iAFpOw7Y9CY7P9ZrWcu4tlQ/BdYQ2O HzydHeugU1c/A== Date: Tue, 9 Apr 2024 15:59:59 +0200 From: Frederic Weisbecker To: Oleg Nesterov Cc: Nick Piggin , Tejun Heo , Leonardo Bras , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Lai Jiangshan , linux-kernel@vger.kernel.org, Junyao Zhao , Chris von Recklinghausen Subject: Re: Nohz_full on boot CPU is broken (was: Re: [PATCH v2 1/1] wq: Avoid using isolated cpus' timers on queue_delayed_work) Message-ID: References: <20240130010046.2730139-2-leobras@redhat.com> <20240402105847.GA24832@redhat.com> <20240403203814.GD31764@redhat.com> <20240405140449.GB22839@redhat.com> <20240407130914.GA10796@redhat.com> <20240409130727.GC29396@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: <20240409130727.GC29396@redhat.com> Le Tue, Apr 09, 2024 at 03:07:28PM +0200, Oleg Nesterov a ?crit : > On 04/09, Frederic Weisbecker wrote: > > > > Le Sun, Apr 07, 2024 at 03:09:14PM +0200, Oleg Nesterov a ?crit : > > > Well, the changelog says > > > > > > nohz_full has been trialed at a large supercomputer site and found to > > > significantly reduce jitter. In order to deploy it in production, they > > > need CPU0 to be nohz_full > > > > > > so I guess this feature has users. > > > > > > But after the commit aae17ebb53cd3da ("workqueue: Avoid using isolated cpus' > > > timers on queue_delayed_work") the kernel will crash at boot time if the boot > > > CPU is nohz_full. > > > > Right but there are many possible calls to housekeeping on boot before the > > first housekeeper becomes online. > > Well, it seems that other callers are more or less fine in this respect... > At least the kernel boots fine with that commit reverted. > > But a) I didn't try to really check, and b) this doesn't matter. > > I agree, and that is why I never blamed this change in queue_delayed_work(). > > OK, you seem to agree with the patch below, I'll write the changelog/comment > and send it "officially". > > Or did I misunderstand you? Works for me! Thanks. > > Oleg. > > > diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c > index 373d42c707bc..e912555c6fc8 100644 > --- a/kernel/sched/isolation.c > +++ b/kernel/sched/isolation.c > @@ -46,7 +46,11 @@ int housekeeping_any_cpu(enum hk_type type) > if (cpu < nr_cpu_ids) > return cpu; > > - return cpumask_any_and(housekeeping.cpumasks[type], cpu_online_mask); > + cpu = cpumask_any_and(housekeeping.cpumasks[type], cpu_online_mask); > + if (cpu < nr_cpu_ids) > + return cpu; > + > + WARN_ON_ONCE(system_state == SYSTEM_RUNNING); > } > } > return smp_processor_id(); >