public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix bug in RCU torture test
@ 2005-12-05 10:58 Srivatsa Vaddagiri
  2005-12-05 12:34 ` Dipankar Sarma
  2005-12-05 13:56 ` Paul E. McKenney
  0 siblings, 2 replies; 3+ messages in thread
From: Srivatsa Vaddagiri @ 2005-12-05 10:58 UTC (permalink / raw)
  To: paulmck; +Cc: Andrew Morton, Dipankar, linux-kernel

While doing some test of RCU torture module, I hit a OOPS in rcu_do_batch,
which was trying to processes callback of a module that was just removed.
This is because we weren't waiting long enough for all callbacks to fire.

Patch below fixes that.

Signed-off-by : Srivatsa Vaddagiri <vatsa@in.ibm.com>


---

 linux-2.6.15-rc5-mm1-root/kernel/rcutorture.c |    3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)

diff -puN kernel/rcutorture.c~rcutorture_fix kernel/rcutorture.c
--- linux-2.6.15-rc5-mm1/kernel/rcutorture.c~rcutorture_fix	2005-12-05 15:33:06.000000000 +0530
+++ linux-2.6.15-rc5-mm1-root/kernel/rcutorture.c	2005-12-05 15:33:17.000000000 +0530
@@ -408,9 +408,8 @@ rcu_torture_cleanup(void)
 	stats_task = NULL;
 
 	/* Wait for all RCU callbacks to fire.  */
+	rcu_barrier();
 
-	for (i = 0; i < RCU_TORTURE_PIPE_LEN; i++)
-		synchronize_rcu();
 	rcu_torture_stats_print();  /* -After- the stats thread is stopped! */
 	printk(KERN_ALERT TORTURE_FLAG
 	       "--- End of test: %s\n",

_


-- 


Thanks and Regards,
Srivatsa Vaddagiri,
Linux Technology Center,
IBM Software Labs,
Bangalore, INDIA - 560017

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

* Re: [PATCH] Fix bug in RCU torture test
  2005-12-05 10:58 [PATCH] Fix bug in RCU torture test Srivatsa Vaddagiri
@ 2005-12-05 12:34 ` Dipankar Sarma
  2005-12-05 13:56 ` Paul E. McKenney
  1 sibling, 0 replies; 3+ messages in thread
From: Dipankar Sarma @ 2005-12-05 12:34 UTC (permalink / raw)
  To: Srivatsa Vaddagiri; +Cc: paulmck, Andrew Morton, linux-kernel

On Mon, Dec 05, 2005 at 04:28:49PM +0530, Srivatsa Vaddagiri wrote:
> While doing some test of RCU torture module, I hit a OOPS in rcu_do_batch,
> which was trying to processes callback of a module that was just removed.
> This is because we weren't waiting long enough for all callbacks to fire.
> 
> diff -puN kernel/rcutorture.c~rcutorture_fix kernel/rcutorture.c
> --- linux-2.6.15-rc5-mm1/kernel/rcutorture.c~rcutorture_fix	2005-12-05 15:33:06.000000000 +0530
> +++ linux-2.6.15-rc5-mm1-root/kernel/rcutorture.c	2005-12-05 15:33:17.000000000 +0530
> @@ -408,9 +408,8 @@ rcu_torture_cleanup(void)
>  	stats_task = NULL;
>  
>  	/* Wait for all RCU callbacks to fire.  */
> +	rcu_barrier();

Andrew,

This patch is dependent on the rcu_barrier patch buried in reiser4
patchset. It makes sense to merge that patch without waiting
for reiser4 since rcutorture is already in mainline. 
I will send an updated documentation patch describing why 
and how modules using RCU should use rcu_barrier().

Thanks
Dipankar

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

* Re: [PATCH] Fix bug in RCU torture test
  2005-12-05 10:58 [PATCH] Fix bug in RCU torture test Srivatsa Vaddagiri
  2005-12-05 12:34 ` Dipankar Sarma
@ 2005-12-05 13:56 ` Paul E. McKenney
  1 sibling, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2005-12-05 13:56 UTC (permalink / raw)
  To: Srivatsa Vaddagiri; +Cc: Andrew Morton, Dipankar, linux-kernel

On Mon, Dec 05, 2005 at 04:28:49PM +0530, Srivatsa Vaddagiri wrote:
> While doing some test of RCU torture module, I hit a OOPS in rcu_do_batch,
> which was trying to processes callback of a module that was just removed.
> This is because we weren't waiting long enough for all callbacks to fire.
> 
> Patch below fixes that.

Good catch -- I had forgotten about rcu_barrier().

							Thanx, Paul

Acked-by: <paulmck@us.ibm.com>

> Signed-off-by : Srivatsa Vaddagiri <vatsa@in.ibm.com>
> 
> 
> ---
> 
>  linux-2.6.15-rc5-mm1-root/kernel/rcutorture.c |    3 +--
>  1 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff -puN kernel/rcutorture.c~rcutorture_fix kernel/rcutorture.c
> --- linux-2.6.15-rc5-mm1/kernel/rcutorture.c~rcutorture_fix	2005-12-05 15:33:06.000000000 +0530
> +++ linux-2.6.15-rc5-mm1-root/kernel/rcutorture.c	2005-12-05 15:33:17.000000000 +0530
> @@ -408,9 +408,8 @@ rcu_torture_cleanup(void)
>  	stats_task = NULL;
>  
>  	/* Wait for all RCU callbacks to fire.  */
> +	rcu_barrier();
>  
> -	for (i = 0; i < RCU_TORTURE_PIPE_LEN; i++)
> -		synchronize_rcu();
>  	rcu_torture_stats_print();  /* -After- the stats thread is stopped! */
>  	printk(KERN_ALERT TORTURE_FLAG
>  	       "--- End of test: %s\n",
> 
> _
> 
> 
> -- 
> 
> 
> Thanks and Regards,
> Srivatsa Vaddagiri,
> Linux Technology Center,
> IBM Software Labs,
> Bangalore, INDIA - 560017
> 

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

end of thread, other threads:[~2005-12-05 13:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-05 10:58 [PATCH] Fix bug in RCU torture test Srivatsa Vaddagiri
2005-12-05 12:34 ` Dipankar Sarma
2005-12-05 13:56 ` 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