Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1308063lqb; Thu, 30 May 2024 06:48:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVemrfCDky1mFZUuO0Kpn0ePIfyIKPpJS5QKBY+jmhvVHEYIhFDfZKeEeWFW7OBv41f460fxKryoVfQqdqWwLew/nflJAUhZSRhpcjE9w== X-Google-Smtp-Source: AGHT+IETYLQmjzotThhclATvrTrNPr2pE1z8IZT1AwsAoeZ6RyaMOkdaJG4tL0b7ppTKWTb9PFzM X-Received: by 2002:a2e:90d2:0:b0:2de:73b5:427c with SMTP id 38308e7fff4ca-2ea847c8a0amr13461361fa.9.1717076938042; Thu, 30 May 2024 06:48:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717076938; cv=pass; d=google.com; s=arc-20160816; b=HRGom3oL/owGrUslu9+1cl0FArFxzhRcTp1kKwxwMipUsOTEFce6FaezJ1s1LM5HPE Dxl8g8zDRaWTXT4UGqEx2+V05sgHVc6XwTUFyIHBFBxRWxmV+qh40UIngGYaT9JzMUgd +ShdZaVra7CGZHvhGJqdfTfsnWWmXJr8Bl+6F1YWM5+llxpBskZqvFEQEyHGZCqP8law 4exdqSkpbNSnbsT1lWvyE/QwqdqlJNik7+qC/95nu/azAfSa565ffFPvdNGfp25JbBzi K+uNNEaoXZM1fWwR5z2aRy8ScVaMZ1gYO3F27NdtgoBqr0xxyrZ6m8VOdXizvwEVqr1E o+3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+DzdCIEZVts69+bVLxKCqFdNwGdCe4+82TfKdU4/KpY=; fh=ruOaVEkAbEh3t4sLFZXGQmBwM4c1/V/LLnMggyZGb4c=; b=GkYz+ExlDT+BzjDIHsHWOPNB6BXo3PJQ5ennghYP/G8YNsx2QqXjm4excSLTGTujEd Ozxw2T3ucOrFsALbObBPWwG5LxsXHSSilDrsjR7L+/oP1j/FnOJdYlYQo7Jy6OO9LpO4 kSE1OrlfexZMpPDerekpxDQpZCDni5Z7D7LD1DZvsVEDDR8XbQ8IZe1bsDp4AZfTNG3Z rfutNqAsgHIWiAsHWXFtwHG7LaTWyKrakK65PjjiFuM6W+jlQ2erzX0XYUbVGRNJDhOH pepxNvi4WrPWGCQ+TaydQYSBKbl+WehzIqH90QTHpEMvjJ+XA6hOnocef3KoA7wLOW0s p3mA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nF3IR2Y4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-195450-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195450-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-579c5bf2a6esi5579178a12.237.2024.05.30.06.48.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 06:48:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195450-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nF3IR2Y4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-195450-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195450-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 BD5E91F22E50 for ; Thu, 30 May 2024 13:48:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCDF41856FC; Thu, 30 May 2024 13:46:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nF3IR2Y4" 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 012C51856F2; Thu, 30 May 2024 13:46:31 +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=1717076792; cv=none; b=g9v3R5Ll8wLSj9xlnMzZq8fIGhPYSR6BkwcLouI57VGcC3EJofKGCOcTpQ2P0CNEum1S2YQjkrwgUycx89mtDjuwO9qPlQTXgc5LsgW8cMqnqalojW05ASJt7pkTK1/axieE+NGVZj+SzCny9+rCDJqnUw9/iIb2r7GxRTEIj0s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717076792; c=relaxed/simple; bh=IYODWsPK3Egb5SjCYr+mLUaF9VNJJZjEGwfR/HQi4pQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i2pcdtqB3TDn1I1QTvHVa3HRrb49HqBMxoSlP+XJ4CAqsFW9/H3TJK6gxrhy+n7RPCXXIjphhzGjT6unORa6fJwM9ugpOU4MOXfVxnxYnmEnWXq3GIOYX16pBlCOJO0k4jWaNeQwwjH8UQpUCPW360cVjGyUXOr/qkCjLbxOsAQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nF3IR2Y4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D801BC32789; Thu, 30 May 2024 13:46:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717076791; bh=IYODWsPK3Egb5SjCYr+mLUaF9VNJJZjEGwfR/HQi4pQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nF3IR2Y4ZsVtVOhtrklXrjfW9q+U4wyf1DTBOrh537kQjoAIyZX/BQPIMdv8vOV11 LRBm9Nh/CK2+uBbReS4QVLWtDPgvEere/pa9irp2SCWQ0SLOl2s+Dr8muiW6/6Hg4n 9k/XXQFiZM49jP19yvJm/N3wdNeIr5BJEplMaiijLTpO9iHyqEF2mC+9SUZHh0hDhW PaK/m6UY+2ne58Wlr/7wjb9vdk2jZVnTnzDdclfgdDdRUb0q5jzv5W3LMXJXOTnFh4 IFqgWHf/+/vz+PApa1FytNayieKKRNOhJF50bY3VKAGU+jzFHM1FbFRC0t6kJ6FkhU BYDxTDw08XgVQ== From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Boqun Feng , Joel Fernandes , Neeraj Upadhyay , "Paul E . McKenney" , Uladzislau Rezki , Zqiang , rcu Subject: [PATCH 09/11] rcu/nocb: Remove SEGCBLIST_RCU_CORE Date: Thu, 30 May 2024 15:45:50 +0200 Message-ID: <20240530134552.5467-10-frederic@kernel.org> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240530134552.5467-1-frederic@kernel.org> References: <20240530134552.5467-1-frederic@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit RCU core can't be running anymore while in the middle of (de-)offloading since this sort of transition now only applies to offline CPUs. The SEGCBLIST_RCU_CORE state can therefore be removed. Signed-off-by: Frederic Weisbecker --- include/linux/rcu_segcblist.h | 9 ++++----- kernel/rcu/rcu_segcblist.h | 9 --------- kernel/rcu/tree.c | 3 --- kernel/rcu/tree_nocb.h | 9 --------- 4 files changed, 4 insertions(+), 26 deletions(-) diff --git a/include/linux/rcu_segcblist.h b/include/linux/rcu_segcblist.h index ba95c06675e1..5469c54cd778 100644 --- a/include/linux/rcu_segcblist.h +++ b/include/linux/rcu_segcblist.h @@ -185,11 +185,10 @@ struct rcu_cblist { * ---------------------------------------------------------------------------- */ #define SEGCBLIST_ENABLED BIT(0) -#define SEGCBLIST_RCU_CORE BIT(1) -#define SEGCBLIST_LOCKING BIT(2) -#define SEGCBLIST_KTHREAD_CB BIT(3) -#define SEGCBLIST_KTHREAD_GP BIT(4) -#define SEGCBLIST_OFFLOADED BIT(5) +#define SEGCBLIST_LOCKING BIT(1) +#define SEGCBLIST_KTHREAD_CB BIT(2) +#define SEGCBLIST_KTHREAD_GP BIT(3) +#define SEGCBLIST_OFFLOADED BIT(4) struct rcu_segcblist { struct rcu_head *head; diff --git a/kernel/rcu/rcu_segcblist.h b/kernel/rcu/rcu_segcblist.h index 4fe877f5f654..7a0962dfee86 100644 --- a/kernel/rcu/rcu_segcblist.h +++ b/kernel/rcu/rcu_segcblist.h @@ -95,15 +95,6 @@ static inline bool rcu_segcblist_is_offloaded(struct rcu_segcblist *rsclp) return false; } -static inline bool rcu_segcblist_completely_offloaded(struct rcu_segcblist *rsclp) -{ - if (IS_ENABLED(CONFIG_RCU_NOCB_CPU) && - !rcu_segcblist_test_flags(rsclp, SEGCBLIST_RCU_CORE)) - return true; - - return false; -} - /* * Are all segments following the specified segment of the specified * rcu_segcblist structure empty of callbacks? (The specified diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 4f1863a0536d..8bec3c0c9636 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -79,9 +79,6 @@ static void rcu_sr_normal_gp_cleanup_work(struct work_struct *); static DEFINE_PER_CPU_SHARED_ALIGNED(struct rcu_data, rcu_data) = { .gpwrap = true, -#ifdef CONFIG_RCU_NOCB_CPU - .cblist.flags = SEGCBLIST_RCU_CORE, -#endif }; static struct rcu_state rcu_state = { .level = { &rcu_state.node[0] }, diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h index af44e75eb0cd..24daf606de0c 100644 --- a/kernel/rcu/tree_nocb.h +++ b/kernel/rcu/tree_nocb.h @@ -1060,7 +1060,6 @@ static int rcu_nocb_rdp_deoffload(struct rcu_data *rdp) WARN_ON_ONCE(rcu_cblist_n_cbs(&rdp->nocb_bypass)); WARN_ON_ONCE(rcu_segcblist_n_cbs(&rdp->cblist)); - rcu_segcblist_set_flags(cblist, SEGCBLIST_RCU_CORE); wake_gp = rdp_offload_toggle(rdp, false, flags); mutex_lock(&rdp_gp->nocb_gp_kthread_mutex); @@ -1168,13 +1167,6 @@ static int rcu_nocb_rdp_offload(struct rcu_data *rdp) swait_event_exclusive(rdp->nocb_state_wq, rcu_segcblist_test_flags(cblist, SEGCBLIST_KTHREAD_GP)); - /* - * All kthreads are ready to work, we can finally enable nocb bypass. - */ - rcu_nocb_lock_irqsave(rdp, flags); - rcu_segcblist_clear_flags(cblist, SEGCBLIST_RCU_CORE); - rcu_nocb_unlock_irqrestore(rdp, flags); - return 0; } @@ -1350,7 +1342,6 @@ void __init rcu_init_nohz(void) rcu_segcblist_init(&rdp->cblist); rcu_segcblist_offload(&rdp->cblist, true); rcu_segcblist_set_flags(&rdp->cblist, SEGCBLIST_KTHREAD_GP); - rcu_segcblist_clear_flags(&rdp->cblist, SEGCBLIST_RCU_CORE); } rcu_organize_nocb_kthreads(); } -- 2.45.1