From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>, linux-kernel@vger.kernel.org
Subject: [patch] RCU: add comments to rcu_pending/rcu_needs_cpu
Date: Thu, 27 Apr 2006 10:11:56 +0200 [thread overview]
Message-ID: <20060427081156.GB9457@osiris.boeblingen.de.ibm.com> (raw)
In-Reply-To: <20060426141205.58675763.akpm@osdl.org>
From: Heiko Carstens <heiko.carstens@de.ibm.com>
Add some comments to rcu_pending() and rcu_needs_cpu().
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
Wording might be poor, but probably better than no comments at all.
kernel/rcupdate.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff -purN a/kernel/rcupdate.c b/kernel/rcupdate.c
--- a/kernel/rcupdate.c 2006-04-27 09:30:23.000000000 +0200
+++ b/kernel/rcupdate.c 2006-04-27 09:56:51.000000000 +0200
@@ -479,12 +479,30 @@ static int __rcu_pending(struct rcu_ctrl
return 0;
}
+/**
+ * rcu_pending - Check for pending RCU work on cpu.
+ * @cpu: cpu to check.
+ *
+ * Does RCU have some work pending on the specified cpu, so that there is a
+ * need to invoke rcu_check_callbacks() on the cpu?
+ */
int rcu_pending(int cpu)
{
return __rcu_pending(&rcu_ctrlblk, &per_cpu(rcu_data, cpu)) ||
__rcu_pending(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu));
}
+/**
+ * rcu_needs_cpu - Determine if cpu will still be needed by RCU.
+ * @cpu: cpu to check.
+ *
+ * Determine whether the specified cpu will still be needed by RCU, or whether
+ * it can be turned off (e.g. by entering a tickless idle state).
+ * Note the difference to rcu_pending() which checks if there is some work to
+ * do that can be done immediately. While this function in addition checks if
+ * there would be some work to do if e.g. a different cpu finished working on
+ * the current batch.
+ */
int rcu_needs_cpu(int cpu)
{
struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
next prev parent reply other threads:[~2006-04-27 8:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-24 11:11 [patch] RCU: introduce rcu_soon_pending() interface Heiko Carstens
2006-04-24 23:09 ` Andrew Morton
2006-04-25 5:27 ` Heiko Carstens
2006-04-25 11:46 ` Paul E. McKenney
2006-04-25 11:52 ` Heiko Carstens
2006-04-25 12:08 ` Paul E. McKenney
2006-04-25 12:27 ` [patch] RCU: introduce rcu_needs_cpu() interface Heiko Carstens
[not found] ` <20060426141205.58675763.akpm@osdl.org>
2006-04-27 8:11 ` Heiko Carstens [this message]
2006-05-01 21:57 ` [patch] RCU: add comments to rcu_pending/rcu_needs_cpu Paul E. McKenney
2006-05-02 6:35 ` Heiko Carstens
2006-04-25 12:28 ` [patch] s390: exploit rcu_needs_cpu() interface Heiko Carstens
2006-04-25 11:23 ` [patch] RCU: introduce rcu_soon_pending() interface Paul E. McKenney
2006-04-25 11:33 ` Martin Schwidefsky
2006-04-25 11:48 ` Paul E. McKenney
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=20060427081156.GB9457@osiris.boeblingen.de.ibm.com \
--to=heiko.carstens@de.ibm.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@us.ibm.com \
/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®