[patch] RCU: add comments to rcu_pending/rcu_needs_cpu

From: Heiko Carstens
Date: Thu Apr 27 2006 - 04:11:56 EST


From: Heiko Carstens <heiko.carstens@xxxxxxxxxx>

Add some comments to rcu_pending() and rcu_needs_cpu().

Signed-off-by: Heiko Carstens <heiko.carstens@xxxxxxxxxx>
---

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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/