linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] rcu: uninline __rcu_pending()
@ 2006-01-08 19:19 Oleg Nesterov
  2006-01-09  4:17 ` Linus Torvalds
  2006-01-09 17:20 ` Paul E. McKenney
  0 siblings, 2 replies; 4+ messages in thread
From: Oleg Nesterov @ 2006-01-08 19:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Dipankar Sarma, Manfred Spraul, Linus Torvalds, Paul E. McKenney,
	Andrew Morton

__rcu_pending() is rather fat and called twice from rcu_pending().

rcu_pending() has multiple callers, and not that small too.

This patch uninlines both of them.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- 2.6.15/include/linux/rcupdate.h~1_OUTL	2006-01-03 21:15:58.000000000 +0300
+++ 2.6.15/include/linux/rcupdate.h	2006-01-08 21:36:07.000000000 +0300
@@ -125,36 +125,7 @@ static inline void rcu_bh_qsctr_inc(int 
 	rdp->passed_quiesc = 1;
 }
 
-static inline int __rcu_pending(struct rcu_ctrlblk *rcp,
-						struct rcu_data *rdp)
-{
-	/* This cpu has pending rcu entries and the grace period
-	 * for them has completed.
-	 */
-	if (rdp->curlist && !rcu_batch_before(rcp->completed, rdp->batch))
-		return 1;
-
-	/* This cpu has no pending entries, but there are new entries */
-	if (!rdp->curlist && rdp->nxtlist)
-		return 1;
-
-	/* This cpu has finished callbacks to invoke */
-	if (rdp->donelist)
-		return 1;
-
-	/* The rcu core waits for a quiescent state from the cpu */
-	if (rdp->quiescbatch != rcp->cur || rdp->qs_pending)
-		return 1;
-
-	/* nothing to do */
-	return 0;
-}
-
-static inline 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));
-}
+extern int rcu_pending(int cpu);
 
 /**
  * rcu_read_lock - mark the beginning of an RCU read-side critical section.
--- 2.6.15/kernel/rcupdate.c~1_OUTL	2006-01-03 21:15:58.000000000 +0300
+++ 2.6.15/kernel/rcupdate.c	2006-01-08 21:35:21.000000000 +0300
@@ -442,6 +442,36 @@ static void rcu_process_callbacks(unsign
 				&__get_cpu_var(rcu_bh_data));
 }
 
+static int __rcu_pending(struct rcu_ctrlblk *rcp, struct rcu_data *rdp)
+{
+	/* This cpu has pending rcu entries and the grace period
+	 * for them has completed.
+	 */
+	if (rdp->curlist && !rcu_batch_before(rcp->completed, rdp->batch))
+		return 1;
+
+	/* This cpu has no pending entries, but there are new entries */
+	if (!rdp->curlist && rdp->nxtlist)
+		return 1;
+
+	/* This cpu has finished callbacks to invoke */
+	if (rdp->donelist)
+		return 1;
+
+	/* The rcu core waits for a quiescent state from the cpu */
+	if (rdp->quiescbatch != rcp->cur || rdp->qs_pending)
+		return 1;
+
+	/* nothing to do */
+	return 0;
+}
+
+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));
+}
+
 void rcu_check_callbacks(int cpu, int user)
 {
 	if (user ||

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/5] rcu: uninline __rcu_pending()
  2006-01-08 19:19 [PATCH 1/5] rcu: uninline __rcu_pending() Oleg Nesterov
@ 2006-01-09  4:17 ` Linus Torvalds
  2006-01-09  5:27   ` Paul E. McKenney
  2006-01-09 17:20 ` Paul E. McKenney
  1 sibling, 1 reply; 4+ messages in thread
From: Linus Torvalds @ 2006-01-09  4:17 UTC (permalink / raw)
  To: Oleg Nesterov
  Cc: linux-kernel, Dipankar Sarma, Manfred Spraul, Paul E. McKenney,
	Andrew Morton


Paul, 
 RCU patches always make me worry, so can you please Ack or Nack this 
series?

		Linus


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/5] rcu: uninline __rcu_pending()
  2006-01-09  4:17 ` Linus Torvalds
@ 2006-01-09  5:27   ` Paul E. McKenney
  0 siblings, 0 replies; 4+ messages in thread
From: Paul E. McKenney @ 2006-01-09  5:27 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Oleg Nesterov, linux-kernel, Dipankar Sarma, Manfred Spraul,
	Andrew Morton

On Sun, Jan 08, 2006 at 08:17:51PM -0800, Linus Torvalds wrote:
> 
> Paul, 
>  RCU patches always make me worry, so can you please Ack or Nack this 
> series?

Me too, especially mine!

I will look this over carefully and either Ack or Nack with diagnostics.

						Thanx, Paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/5] rcu: uninline __rcu_pending()
  2006-01-08 19:19 [PATCH 1/5] rcu: uninline __rcu_pending() Oleg Nesterov
  2006-01-09  4:17 ` Linus Torvalds
@ 2006-01-09 17:20 ` Paul E. McKenney
  1 sibling, 0 replies; 4+ messages in thread
From: Paul E. McKenney @ 2006-01-09 17:20 UTC (permalink / raw)
  To: Oleg Nesterov
  Cc: linux-kernel, Dipankar Sarma, Manfred Spraul, Linus Torvalds,
	Andrew Morton

On Sun, Jan 08, 2006 at 10:19:16PM +0300, Oleg Nesterov wrote:
> __rcu_pending() is rather fat and called twice from rcu_pending().
> 
> rcu_pending() has multiple callers, and not that small too.
> 
> This patch uninlines both of them.

Looks good -- I must defer to Dipankar on any performance problems, but
I would not expect any this far off of the fastpaths.  Also makes
handling multiple different RCU implementations a bit easier on the
eyes.

							Thanx, Paul

Acked-by: Paul E. McKenney <paulmck@us.ibm.com>
> Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
> 
> --- 2.6.15/include/linux/rcupdate.h~1_OUTL	2006-01-03 21:15:58.000000000 +0300
> +++ 2.6.15/include/linux/rcupdate.h	2006-01-08 21:36:07.000000000 +0300
> @@ -125,36 +125,7 @@ static inline void rcu_bh_qsctr_inc(int 
>  	rdp->passed_quiesc = 1;
>  }
>  
> -static inline int __rcu_pending(struct rcu_ctrlblk *rcp,
> -						struct rcu_data *rdp)
> -{
> -	/* This cpu has pending rcu entries and the grace period
> -	 * for them has completed.
> -	 */
> -	if (rdp->curlist && !rcu_batch_before(rcp->completed, rdp->batch))
> -		return 1;
> -
> -	/* This cpu has no pending entries, but there are new entries */
> -	if (!rdp->curlist && rdp->nxtlist)
> -		return 1;
> -
> -	/* This cpu has finished callbacks to invoke */
> -	if (rdp->donelist)
> -		return 1;
> -
> -	/* The rcu core waits for a quiescent state from the cpu */
> -	if (rdp->quiescbatch != rcp->cur || rdp->qs_pending)
> -		return 1;
> -
> -	/* nothing to do */
> -	return 0;
> -}
> -
> -static inline 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));
> -}
> +extern int rcu_pending(int cpu);
>  
>  /**
>   * rcu_read_lock - mark the beginning of an RCU read-side critical section.
> --- 2.6.15/kernel/rcupdate.c~1_OUTL	2006-01-03 21:15:58.000000000 +0300
> +++ 2.6.15/kernel/rcupdate.c	2006-01-08 21:35:21.000000000 +0300
> @@ -442,6 +442,36 @@ static void rcu_process_callbacks(unsign
>  				&__get_cpu_var(rcu_bh_data));
>  }
>  
> +static int __rcu_pending(struct rcu_ctrlblk *rcp, struct rcu_data *rdp)
> +{
> +	/* This cpu has pending rcu entries and the grace period
> +	 * for them has completed.
> +	 */
> +	if (rdp->curlist && !rcu_batch_before(rcp->completed, rdp->batch))
> +		return 1;
> +
> +	/* This cpu has no pending entries, but there are new entries */
> +	if (!rdp->curlist && rdp->nxtlist)
> +		return 1;
> +
> +	/* This cpu has finished callbacks to invoke */
> +	if (rdp->donelist)
> +		return 1;
> +
> +	/* The rcu core waits for a quiescent state from the cpu */
> +	if (rdp->quiescbatch != rcp->cur || rdp->qs_pending)
> +		return 1;
> +
> +	/* nothing to do */
> +	return 0;
> +}
> +
> +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));
> +}
> +
>  void rcu_check_callbacks(int cpu, int user)
>  {
>  	if (user ||
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-01-09 17:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-08 19:19 [PATCH 1/5] rcu: uninline __rcu_pending() Oleg Nesterov
2006-01-09  4:17 ` Linus Torvalds
2006-01-09  5:27   ` Paul E. McKenney
2006-01-09 17:20 ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).