From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755688AbeARKej (ORCPT ); Thu, 18 Jan 2018 05:34:39 -0500 Received: from mga05.intel.com ([192.55.52.43]:13147 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754759AbeARKei (ORCPT ); Thu, 18 Jan 2018 05:34:38 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,377,1511856000"; d="scan'208";a="167112750" Date: Thu, 18 Jan 2018 18:33:43 +0800 From: "Liu, Changcheng" To: Lai Jiangshan , Mathieu Desnoyers , "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, changcheng.liu@intel.com Subject: [PATCH] rcu: refine structure rcu_node field for rcu boost Message-ID: <20180118103342.GA114176@sofia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Do not allocate space for rcu boost field when RCU BOOST is not configured. Signed-off-by: Liu Changcheng diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h index 46a5d19..88f087e 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h @@ -129,6 +129,7 @@ struct rcu_node { /* if there is no such task. If there */ /* is no current expedited grace period, */ /* then there can cannot be any such task. */ +#ifdef CONFIG_RCU_BOOST struct list_head *boost_tasks; /* Pointer to first task that needs to be */ /* priority boosted, or NULL if no priority */ @@ -153,6 +154,8 @@ struct rcu_node { /* Number of tasks boosted for expedited GP. */ unsigned long n_normal_boosts; /* Number of tasks boosted for normal GP. */ +#endif/* #ifdef CONFIG_RCU_BOOST*/ + #ifdef CONFIG_RCU_NOCB_CPU struct swait_queue_head nocb_gp_wq[2]; /* Place for rcu_nocb_kthread() to wait GP. */ diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index db85ca3..fee0b1e 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -506,8 +506,10 @@ void rcu_read_unlock_special(struct task_struct *t) if (IS_ENABLED(CONFIG_RCU_BOOST)) { /* Snapshot ->boost_mtx ownership w/rnp->lock held. */ drop_boost_mutex = rt_mutex_owner(&rnp->boost_mtx) == t; +#ifdef CONFIG_RCU_BOOST if (&t->rcu_node_entry == rnp->boost_tasks) rnp->boost_tasks = np; +#endif } /* -- 2.7.4