From mboxrd@z Thu Jan 1 00:00:00 1970 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 EAFB33D88F6 for ; Tue, 21 Apr 2026 14:26: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=1776781566; cv=none; b=k+12I94VEQM0wQW1sTyoPGKYCTAW55rb1a3GJ5E0Bcu7D4ZTOsdZYgdSTDhYMVPZHhnhyfz2V4OeVUdh8BGQHKknpciYYp7lxsc9kJr+7HpTj+lMFb6BnnOQfMyw5OAgTCbUTrlsjM997OKGFCQTOgciyuaLdOnQYlIECMQXgHo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776781566; c=relaxed/simple; bh=SG9TyVz2FKGn4It97z8qxSOz48ceXBCGCNeEx9UkI/8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nYCAMvRgsc0K3lv9sozactvRrG9ZlAO1PNTGo1b4icrT0R6OzrEc91YpCEtyq+kvTUJFiKS09w7jahTRW5uZ8lub1hqwDGvD7L72zZI5ia2fwoH5O/22UJf2kwoAn3tJ+tmDLWlH4c5KXLcKxqVU9Dvx/tfRs+ETYJs6bWrtses= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=P6im2576; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="P6im2576" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776781564; 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=cpQv2nmOkTVoNtTsiQ2DrTic771j3rKCjuGbBpejCvU=; b=P6im2576ANcjDXKJWlJp3M3kBiZYebL7KBF0/eZKNZ/qfm7spSGFXi4n50GSgmjbco+Cci 5fqmr4t7rB21gx1w3c0nNq7lOLKXuMOUUaXgJ5qNLbZamSZ040TpWtI5i3zo14Up1Y9I9c gxZf3+hahWZjl2FGT5n66JB1B7c1V2g= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-453-xs3N2oRYOFOjpa-3JwwkQg-1; Tue, 21 Apr 2026 10:25:58 -0400 X-MC-Unique: xs3N2oRYOFOjpa-3JwwkQg-1 X-Mimecast-MFC-AGG-ID: xs3N2oRYOFOjpa-3JwwkQg_1776781553 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 248D51956054; Tue, 21 Apr 2026 14:25:52 +0000 (UTC) Received: from [10.22.81.187] (unknown [10.22.81.187]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2506C180047F; Tue, 21 Apr 2026 14:25:44 +0000 (UTC) Message-ID: <0281dde0-e00f-4f38-a15a-3ade02ecbb59@redhat.com> Date: Tue, 21 Apr 2026 10:25:43 -0400 Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 10/23] cpu: Use RCU to protect access of HK_TYPE_TIMER cpumask To: Thomas Gleixner , Tejun Heo , Johannes Weiner , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Jonathan Corbet , Shuah Khan , Catalin Marinas , Will Deacon , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Guenter Roeck , Frederic Weisbecker , "Paul E. McKenney" , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Anna-Maria Behnsen , Ingo Molnar , Chen Ridong , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman Cc: cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-hwmon@vger.kernel.org, rcu@vger.kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, Costa Shulyupin , Qiliang Yuan References: <20260421030351.281436-1-longman@redhat.com> <20260421030351.281436-11-longman@redhat.com> <87wly0bsh5.ffs@tglx> Content-Language: en-US From: Waiman Long In-Reply-To: <87wly0bsh5.ffs@tglx> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 On 4/21/26 4:57 AM, Thomas Gleixner wrote: > On Mon, Apr 20 2026 at 23:03, Waiman Long wrote: >> As HK_TYPE_TIMER cpumask is going to be changeable at run time, use >> RCU to protect access to the cpumask. >> >> Signed-off-by: Waiman Long >> --- >> kernel/cpu.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/kernel/cpu.c b/kernel/cpu.c >> index bc4f7a9ba64e..0d02b5d7a7ba 100644 >> --- a/kernel/cpu.c >> +++ b/kernel/cpu.c >> @@ -1890,6 +1890,8 @@ int freeze_secondary_cpus(int primary) >> cpu_maps_update_begin(); >> if (primary == -1) { >> primary = cpumask_first(cpu_online_mask); >> + >> + guard(rcu)(); >> if (!housekeeping_cpu(primary, HK_TYPE_TIMER)) >> primary = housekeeping_any_cpu(HK_TYPE_TIMER); > housekeeping_cpu() and housekeeping_any_cpu() can operate on two > different CPU masks once the runtime update is enabled. > > Seriously? Good point, will fix that in the next version. Cheers, Longman