Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1965874lqe; Tue, 9 Apr 2024 06:09:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWzRTVFg3PEx+kBagPf3JleW/ygZYJSbiZzFQLs1R2uKPPKSYsW9t3rcDPS23Jg+PEv2Wk9RgkSteV+Un8z/7T/0DnEYXCr6KEsR3njyw== X-Google-Smtp-Source: AGHT+IG2KYmBvHeoA3u7JMAc6hrbuBH7WzGPjPhRe8zwnsAkQs4bXkiPXureOv6Q77EfFZL3jWz6 X-Received: by 2002:ac5:c2ca:0:b0:4c9:b8a8:78d4 with SMTP id i10-20020ac5c2ca000000b004c9b8a878d4mr7991254vkk.3.1712668169819; Tue, 09 Apr 2024 06:09:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712668169; cv=pass; d=google.com; s=arc-20160816; b=fHlGjfy/O42JEOoxJlUCxuauZNszR+dx+t49n/BgOuOxaY3oafbperKDgpOr8YvX4y G7Q1++UQfF5y0m4neA4zt6p4BgM+JrNKOoMkjVwXyIC2yrGnJmny0ahVrPfzHBx1Suts 7d/PT+VVQFbb7uJo5d7CrIpUP/P3mhBvK6fY8OYSDM2uqCvZHBXxSz93EnhhEwLz+txm FUhb2SvomeIUDIE8XtMpHFvgJqZofOIsi4mnsnmZjy+gplRz9A3JEDz12Vd8A7AiBZxF 0mNktNZUW41uElj83W/4XKzSz6EikeZNKsAEXl+arzlAqCnPG5gknyEHAHwSgqWN1iTO fqcA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent: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=doQL+4ACpKfG0Ql9jhMoc9todtt+MGTYR4v3X2YBERw=; fh=2InlgaUf6YM4x7N5en8bF5Ts9/p78k4HiB3/TZmHd4c=; b=frJy2W3YKds28x+G3NSxlOn1ydkfmB1Rh4XwgNCKvxs5Y2czIJdyPAPIq91/nmxdSL mb+Q9tjDvP7nXcS3LV0Sjl2hoEy+DwPbE9D8aPrOsUupFty2/f5jMFQImiyp/tA5UefM pVgpPGRKKnkRKFiANImxL+0NVk181anPlvbqhx1oUJxckE9v5SrMAp+gue2qUCiCNIuf lQt1iG3R5CK/D1lcJ3x/7tbteG2OX+BmAPzP0taOhpTM/DWYno9TO8wZjwK5Hl4p8vr5 j4E39GHdz2NJ6/8yjHLB7tsuadseb0nhZ+mmFoyYm8SJyr0ElYY8pW1VP2K7ravUDJL1 J4wQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HfAWYJOU; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-136919-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136919-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 19-20020a0561220a1300b004d337e8efd9si1295689vkn.194.2024.04.09.06.09.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 06:09:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-136919-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HfAWYJOU; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-136919-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136919-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8725A1C21E79 for ; Tue, 9 Apr 2024 13:09:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6814412F363; Tue, 9 Apr 2024 13:09:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HfAWYJOU" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 0FAF012E1E3 for ; Tue, 9 Apr 2024 13:09:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712668146; cv=none; b=e+ISQxltP39/kDW0PnDeO802WAwC0huy/kqRna8M/PWvhqmIm0Dg2+jfdnOkQK5tnWqqxPVl13QDe5zmNMA6fpk7nsUy+HeZgwxWEfHhAusz5lbSie3neZWIdNj2Q9OQVVmIy9kVZYqCvWGwRZmXNxSQfTaH6BgRpkp4s/TCWJg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712668146; c=relaxed/simple; bh=YyfkRCglHo3mOCrB+ZApepkzfFGd7pYwbTakFb2oAvE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CBiea2kCXnvf4JFN6EiSu/kN+ITKYjcADulSggGhbXw6L4h+T6lqQxjmz7uNQc6Ez08PopqgMzDrgu4QI8b61tGfr47alauYpYdHVWiNvmEcww3qWaHwNqumHIolF9DGgRpxNMT2BVUPOGydepENZ8+SaChdzGqhPi3EPuy7N9U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=HfAWYJOU; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712668143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=doQL+4ACpKfG0Ql9jhMoc9todtt+MGTYR4v3X2YBERw=; b=HfAWYJOUorGEDQ866XzFk9RgEeupZSUlf0bc+9WZSK64sKvgIpCZvFGA7nqNItvL2L99dp oygNto6AJ8Okw780aerpxasXCaoe2Dzi1tmmD7HAom4XNWnVEsWeIs5S4wdgpbqmTeX6Vr PHyhjR1+qVsfpbdTLuH31YXI97uuzeo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-133-D1mhsbVHOUWIHNJgfCnzaA-1; Tue, 09 Apr 2024 09:09:02 -0400 X-MC-Unique: D1mhsbVHOUWIHNJgfCnzaA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CFC92889AAA; Tue, 9 Apr 2024 13:09:01 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.225.56]) by smtp.corp.redhat.com (Postfix) with SMTP id 4EFC21C060A6; Tue, 9 Apr 2024 13:08:59 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 9 Apr 2024 15:07:36 +0200 (CEST) Date: Tue, 9 Apr 2024 15:07:28 +0200 From: Oleg Nesterov To: Frederic Weisbecker 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: <20240409130727.GC29396@redhat.com> References: <20240130010046.2730139-2-leobras@redhat.com> <20240402105847.GA24832@redhat.com> <20240403203814.GD31764@redhat.com> <20240405140449.GB22839@redhat.com> <20240407130914.GA10796@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: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 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? 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();