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.133.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 3850C36C9E1 for ; Tue, 21 Apr 2026 03:06:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776740779; cv=none; b=UzGRYu9CjK8+0mc6jKvZfvy4g90CSDSnujkQfh1G4sJglrD10fj/txiXJQs3lvuEptsGkogpQ87MtOBZbO5lSq+VVFCjohru/NZIGpR+b+XTviGBJBu+fmmHdqBiNipbmm2+OcjZupSkmTyqeMO9QJU9pDKxTSQoejO0TnZnGd8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776740779; c=relaxed/simple; bh=vsZBuAhEaXxVIC0Xh69lKeORTO6BKToGt/jnTc3OjjM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qf3i1aeFvMrJXKnNeq6OBjNkq3zQKy5c2u88zY5EFgLmwJkqmVHsQKW4EXp/SwHRITp/JXO++hdxV74SE/pnYYAxLt1S0/fUY8CEFV2xKy7b093WgdTEA8PiUm81h6T9VWpwEOfjM+12xT1PT5H3a3dsYnY28zdwUPCaWX+KGbQ= 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=G4au4Yuh; arc=none smtp.client-ip=170.10.133.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="G4au4Yuh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776740777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Bmswg87Ok06uTiC+ecczzP/a3g4t/eC6rxArbw4L2sc=; b=G4au4Yuh0GDsYZGHI+sSauZkRP8yVhBvbBHPfNHdvBTtajha2GGZAyd93pSXYkMGonMDYj 5iwzFhVK7fIBlhwBPFrXR3Tf9IVFmZyMqo24GIF92+BM4c90Z8uZDJszGUp+8MUop9yqtV QHnm81j3jTlOgAPZ8fjZmUADbsQgDT4= Received: from mx-prod-mc-05.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-20-tKbAhyaOMFy0K2mFNqLy0Q-1; Mon, 20 Apr 2026 23:06:13 -0400 X-MC-Unique: tKbAhyaOMFy0K2mFNqLy0Q-1 X-Mimecast-MFC-AGG-ID: tKbAhyaOMFy0K2mFNqLy0Q_1776740768 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B65631956089; Tue, 21 Apr 2026 03:06:08 +0000 (UTC) Received: from llong-thinkpadp16vgen1.westford.csb (unknown [10.22.65.81]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 82F3519560B7; Tue, 21 Apr 2026 03:06:01 +0000 (UTC) From: Waiman Long To: Tejun Heo , Johannes Weiner , =?UTF-8?q?Michal=20Koutn=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 , Thomas Gleixner , 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 , Waiman Long Subject: [PATCH 10/23] cpu: Use RCU to protect access of HK_TYPE_TIMER cpumask Date: Mon, 20 Apr 2026 23:03:38 -0400 Message-ID: <20260421030351.281436-11-longman@redhat.com> In-Reply-To: <20260421030351.281436-1-longman@redhat.com> References: <20260421030351.281436-1-longman@redhat.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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); } else { -- 2.53.0