2006-05-01 21:56:52

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [patch] RCU: add comments to rcu_pending/rcu_needs_cpu

On Thu, Apr 27, 2006 at 10:11:56AM +0200, Heiko Carstens wrote:
> From: Heiko Carstens <[email protected]>
>
> Add some comments to rcu_pending() and rcu_needs_cpu().
>
> Signed-off-by: Heiko Carstens <[email protected]>
> ---
>
> Wording might be poor, but probably better than no comments at all.

But these are internal interfaces for RCU, so doesn't seem like they
should go into docbook. Quite different than (say) rcu_read_lock()
or call_rcu().

How about something like the following instead?

Thanx, Paul

Signed-off-by: <[email protected]>
---

diff -urpNa -X dontdiff linux-2.6.17-rc3-rnc/kernel/rcupdate.c linux-2.6.17-rc3-rnc.pem/kernel/rcupdate.c
--- linux-2.6.17-rc3-rnc/kernel/rcupdate.c 2006-05-01 14:42:30.000000000 -0700
+++ linux-2.6.17-rc3-rnc.pem/kernel/rcupdate.c 2006-05-01 14:48:19.000000000 -0700
@@ -479,12 +479,25 @@ static int __rcu_pending(struct rcu_ctrl
return 0;
}

+/*
+ * Check to see if there is any immediate RCU-related work to be done
+ * by the current CPU, returning 1 if so. This function is part of the
+ * RCU implementation; it is -not- an exported member of the RCU API.
+ */
+
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));
}

+/*
+ * Check to see if any future RCU-related work will need to be done
+ * by the current CPU, even if none need be done immediately, returning
+ * 1 if so. This function is part of the RCU implementation; it is -not-
+ * an exported member of the RCU API.
+ */
+
int rcu_needs_cpu(int cpu)
{
struct rcu_data *rdp = &per_cpu(rcu_data, cpu);


2006-05-02 06:35:38

by Heiko Carstens

[permalink] [raw]
Subject: Re: [patch] RCU: add comments to rcu_pending/rcu_needs_cpu

> > Add some comments to rcu_pending() and rcu_needs_cpu().
>
> But these are internal interfaces for RCU, so doesn't seem like they
> should go into docbook. Quite different than (say) rcu_read_lock()
> or call_rcu().
>
> How about something like the following instead?

Fine with me :)