From: Zqiang <qiang1.zhang@intel.com>
To: paulmck@kernel.org, frederic@kernel.org, quic_neeraju@quicinc.com
Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] rcu: Only check tasks blocked on leaf rcu_nodes for PREEMPT_RCU
Date: Fri, 22 Jul 2022 08:52:13 +0800 [thread overview]
Message-ID: <20220722005213.3511188-1-qiang1.zhang@intel.com> (raw)
In PREEMPT_RCU kernel, for multi-node rcu tree, if the RCU read
critical section is preempted, the current task are only queued
leaf rcu_node blkd list, for single-node rcu tree, the root node
is also leaf node.
This commit add rcu_is_leaf_node() to filter out checks for non-leaf
rcu_node.
Signed-off-by: Zqiang <qiang1.zhang@intel.com>
---
kernel/rcu/tree_plugin.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index b2219577fbe2..a9df11ec65af 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -693,6 +693,8 @@ static void rcu_preempt_check_blocked_tasks(struct rcu_node *rnp)
RCU_LOCKDEP_WARN(preemptible(), "rcu_preempt_check_blocked_tasks() invoked with preemption enabled!!!\n");
raw_lockdep_assert_held_rcu_node(rnp);
+ if (!rcu_is_leaf_node(rnp))
+ goto end;
if (WARN_ON_ONCE(rcu_preempt_blocked_readers_cgp(rnp)))
dump_blkd_tasks(rnp, 10);
if (rcu_preempt_has_tasks(rnp) &&
@@ -703,6 +705,7 @@ static void rcu_preempt_check_blocked_tasks(struct rcu_node *rnp)
trace_rcu_unlock_preempted_task(TPS("rcu_preempt-GPS"),
rnp->gp_seq, t->pid);
}
+end:
WARN_ON_ONCE(rnp->qsmask);
}
@@ -1178,7 +1181,8 @@ static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags)
*/
static void rcu_preempt_boost_start_gp(struct rcu_node *rnp)
{
- rnp->boost_time = jiffies + RCU_BOOST_DELAY_JIFFIES;
+ if (rcu_is_leaf_node(rnp))
+ rnp->boost_time = jiffies + RCU_BOOST_DELAY_JIFFIES;
}
/*
--
2.25.1
next reply other threads:[~2022-07-22 0:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-22 0:52 Zqiang [this message]
2022-07-22 1:16 ` Paul E. McKenney
2022-07-22 1:45 ` Zhang, Qiang1
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220722005213.3511188-1-qiang1.zhang@intel.com \
--to=qiang1.zhang@intel.com \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=quic_neeraju@quicinc.com \
--cc=rcu@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®