linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [[PATCH URCU formal]] Restructure urcu_updater() to more accurately reflect actual failure scenario.
@ 2009-02-20  1:57 Paul E. McKenney
  2009-02-20 17:15 ` Mathieu Desnoyers
  0 siblings, 1 reply; 2+ messages in thread
From: Paul E. McKenney @ 2009-02-20  1:57 UTC (permalink / raw)
  To: ltt-dev; +Cc: compudj, bert.wesarg, bob, linux-kernel

Restructure urcu_updater() to more accurately reflect actual failure
scenario.

This allows an easier transformation to force failure -- simple #ifdef
out the second counter flip out of urcu_updater()'s model of
"current synchronize_rcu()".

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 formal-model/urcu.spin |   41 +++++++++++++++++++++++++++++++----------
 1 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/formal-model/urcu.spin b/formal-model/urcu.spin
index eea18e8..3e18457 100644
--- a/formal-model/urcu.spin
+++ b/formal-model/urcu.spin
@@ -187,10 +187,38 @@ proctype urcu_reader()
 
 proctype urcu_updater()
 {
+	/* prior synchronize_rcu(), second counter flip. */
+	need_mb = 1;
+	do
+	:: need_mb == 1 -> skip;
+	:: need_mb == 0 -> break;
+	od;
+	urcu_gp_ctr = urcu_gp_ctr + RCU_GP_CTR_BIT;
+	need_mb = 1;
+	do
+	:: need_mb == 1 -> skip;
+	:: need_mb == 0 -> break;
+	od;
+	do
+	:: 1 ->
+		if
+		:: (urcu_active_readers & RCU_GP_CTR_NEST_MASK) != 0 &&
+		   (urcu_active_readers & ~RCU_GP_CTR_NEST_MASK) !=
+		   (urcu_gp_ctr & ~RCU_GP_CTR_NEST_MASK) ->
+			skip;
+		:: else -> break;
+		fi;
+	od;
+	need_mb = 1;
+	do
+	:: need_mb == 1 -> skip;
+	:: need_mb == 0 -> break;
+	od;
+
 	/* Removal statement, e.g., list_del_rcu(). */
 	removed = 1;
 
-	/* synchronize_rcu(), first counter flip. */
+	/* current synchronize_rcu(), first counter flip. */
 	need_mb = 1;
 	do
 	:: need_mb == 1 -> skip;
@@ -204,15 +232,13 @@ proctype urcu_updater()
 	od;
 	do
 	:: 1 ->
-		printf("urcu_gp_ctr=%x urcu_active_readers=%x\n", urcu_gp_ctr, urcu_active_readers);
-		printf("urcu_gp_ctr&0x7f=%x urcu_active_readers&0x7f=%x\n", urcu_gp_ctr & ~RCU_GP_CTR_NEST_MASK, urcu_active_readers & ~RCU_GP_CTR_NEST_MASK);
 		if
 		:: (urcu_active_readers & RCU_GP_CTR_NEST_MASK) != 0 &&
 		   (urcu_active_readers & ~RCU_GP_CTR_NEST_MASK) !=
 		   (urcu_gp_ctr & ~RCU_GP_CTR_NEST_MASK) ->
 			skip;
 		:: else -> break;
-		fi
+		fi;
 	od;
 	need_mb = 1;
 	do
@@ -220,10 +246,7 @@ proctype urcu_updater()
 	:: need_mb == 0 -> break;
 	od;
 
-	/* Erroneous removal statement, e.g., list_del_rcu(). */
-	/* removed = 1; */
-
-	/* synchronize_rcu(), second counter flip. */
+	/* current synchronize_rcu(), second counter flip. */
 	need_mb = 1;
 	do
 	:: need_mb == 1 -> skip;
@@ -237,8 +260,6 @@ proctype urcu_updater()
 	od;
 	do
 	:: 1 ->
-		printf("urcu_gp_ctr=%x urcu_active_readers=%x\n", urcu_gp_ctr, urcu_active_readers);
-		printf("urcu_gp_ctr&0x7f=%x urcu_active_readers&0x7f=%x\n", urcu_gp_ctr & ~RCU_GP_CTR_NEST_MASK, urcu_active_readers & ~RCU_GP_CTR_NEST_MASK);
 		if
 		:: (urcu_active_readers & RCU_GP_CTR_NEST_MASK) != 0 &&
 		   (urcu_active_readers & ~RCU_GP_CTR_NEST_MASK) !=
-- 
1.5.2.5


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

* Re: [[PATCH URCU formal]] Restructure urcu_updater() to more accurately reflect actual failure scenario.
  2009-02-20  1:57 [[PATCH URCU formal]] Restructure urcu_updater() to more accurately reflect actual failure scenario Paul E. McKenney
@ 2009-02-20 17:15 ` Mathieu Desnoyers
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Desnoyers @ 2009-02-20 17:15 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: ltt-dev, bert.wesarg, bob, linux-kernel

* Paul E. McKenney (paulmck@linux.vnet.ibm.com) wrote:
> Restructure urcu_updater() to more accurately reflect actual failure
> scenario.
> 
> This allows an easier transformation to force failure -- simple #ifdef
> out the second counter flip out of urcu_updater()'s model of
> "current synchronize_rcu()".
> 

Merged, thanks !

Mathieu

> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> ---
>  formal-model/urcu.spin |   41 +++++++++++++++++++++++++++++++----------
>  1 files changed, 31 insertions(+), 10 deletions(-)
> 
> diff --git a/formal-model/urcu.spin b/formal-model/urcu.spin
> index eea18e8..3e18457 100644
> --- a/formal-model/urcu.spin
> +++ b/formal-model/urcu.spin
> @@ -187,10 +187,38 @@ proctype urcu_reader()
>  
>  proctype urcu_updater()
>  {
> +	/* prior synchronize_rcu(), second counter flip. */
> +	need_mb = 1;
> +	do
> +	:: need_mb == 1 -> skip;
> +	:: need_mb == 0 -> break;
> +	od;
> +	urcu_gp_ctr = urcu_gp_ctr + RCU_GP_CTR_BIT;
> +	need_mb = 1;
> +	do
> +	:: need_mb == 1 -> skip;
> +	:: need_mb == 0 -> break;
> +	od;
> +	do
> +	:: 1 ->
> +		if
> +		:: (urcu_active_readers & RCU_GP_CTR_NEST_MASK) != 0 &&
> +		   (urcu_active_readers & ~RCU_GP_CTR_NEST_MASK) !=
> +		   (urcu_gp_ctr & ~RCU_GP_CTR_NEST_MASK) ->
> +			skip;
> +		:: else -> break;
> +		fi;
> +	od;
> +	need_mb = 1;
> +	do
> +	:: need_mb == 1 -> skip;
> +	:: need_mb == 0 -> break;
> +	od;
> +
>  	/* Removal statement, e.g., list_del_rcu(). */
>  	removed = 1;
>  
> -	/* synchronize_rcu(), first counter flip. */
> +	/* current synchronize_rcu(), first counter flip. */
>  	need_mb = 1;
>  	do
>  	:: need_mb == 1 -> skip;
> @@ -204,15 +232,13 @@ proctype urcu_updater()
>  	od;
>  	do
>  	:: 1 ->
> -		printf("urcu_gp_ctr=%x urcu_active_readers=%x\n", urcu_gp_ctr, urcu_active_readers);
> -		printf("urcu_gp_ctr&0x7f=%x urcu_active_readers&0x7f=%x\n", urcu_gp_ctr & ~RCU_GP_CTR_NEST_MASK, urcu_active_readers & ~RCU_GP_CTR_NEST_MASK);
>  		if
>  		:: (urcu_active_readers & RCU_GP_CTR_NEST_MASK) != 0 &&
>  		   (urcu_active_readers & ~RCU_GP_CTR_NEST_MASK) !=
>  		   (urcu_gp_ctr & ~RCU_GP_CTR_NEST_MASK) ->
>  			skip;
>  		:: else -> break;
> -		fi
> +		fi;
>  	od;
>  	need_mb = 1;
>  	do
> @@ -220,10 +246,7 @@ proctype urcu_updater()
>  	:: need_mb == 0 -> break;
>  	od;
>  
> -	/* Erroneous removal statement, e.g., list_del_rcu(). */
> -	/* removed = 1; */
> -
> -	/* synchronize_rcu(), second counter flip. */
> +	/* current synchronize_rcu(), second counter flip. */
>  	need_mb = 1;
>  	do
>  	:: need_mb == 1 -> skip;
> @@ -237,8 +260,6 @@ proctype urcu_updater()
>  	od;
>  	do
>  	:: 1 ->
> -		printf("urcu_gp_ctr=%x urcu_active_readers=%x\n", urcu_gp_ctr, urcu_active_readers);
> -		printf("urcu_gp_ctr&0x7f=%x urcu_active_readers&0x7f=%x\n", urcu_gp_ctr & ~RCU_GP_CTR_NEST_MASK, urcu_active_readers & ~RCU_GP_CTR_NEST_MASK);
>  		if
>  		:: (urcu_active_readers & RCU_GP_CTR_NEST_MASK) != 0 &&
>  		   (urcu_active_readers & ~RCU_GP_CTR_NEST_MASK) !=
> -- 
> 1.5.2.5
> 

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

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

end of thread, other threads:[~2009-02-20 17:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-20  1:57 [[PATCH URCU formal]] Restructure urcu_updater() to more accurately reflect actual failure scenario Paul E. McKenney
2009-02-20 17:15 ` Mathieu Desnoyers

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).