All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <compudj@krystal.dyndns.org>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: ltt-dev@lists.casi.polymtl.ca, bert.wesarg@googlemail.com,
	bob@watson.ibm.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH URCU formal] Add liveness checks to user-level RCU model.
Date: Fri, 20 Feb 2009 14:46:21 -0500	[thread overview]
Message-ID: <20090220194621.GA7349@Krystal> (raw)
In-Reply-To: <20090220192824.GP6960@linux.vnet.ibm.com>

* Paul E. McKenney (paulmck@linux.vnet.ibm.com) wrote:
> On Fri, Feb 20, 2009 at 01:18:35PM -0500, Mathieu Desnoyers wrote:
> > * Paul E. McKenney (paulmck@linux.vnet.ibm.com) wrote:
> > > Break all potentially infinite loops in both urcu_reader() and
> > > urcu_updater(), ensure that urcu_reader() will process any memory barriers
> > > that urcu_updater() might issue, and formulate a "never" claim that checks
> > > to make sure that if either urcu_reader() or urcu_updater() completes,
> > > then the other will eventually also complete.  Since urcu_reader()
> > > now has a finite number of steps, it must eventually complete.
> > > 
> > > Also replace the code at the end of urcu_reader() that previously absorbed
> > > late memory-barrier requests from urcu_updater with code in urcu_writer()
> > > that checks to see if urcu_reader() has completed.
> > > 
> > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > 
> > Thanks Paul, I'll merge it. However, I am currently reworking our spin
> > tree so we can execute the tests in batch (rather that all at once,
> > which consumes more memory than necessary) and also I am doing a nice
> > build script which lets us create our own LTL formulaes for
> > verification. The never claims will be automatically generated and
> > verified. I'll keep you posted.
> 
> Sounds interesting!  Not sure what you mean by "execute the tests
> in batch", but look forward to seeing it.
> 
> On the LTL, the formula "<>[] (reader_done != 0 && updater_done != 0)"
> didn't do what I want.  The model would kick out an error with the
> reader sitting just before the "reader_done = 1" and the updater spinning
> waiting for the reader to respond to its memory-barrier request.
> 
> So I fell back to the hand-coded formula in the never clause, which
> translates to English as "if either the reader or the updater complete,
> then both the reader and the updater eventually complete".  There might
> be a way to tranlate that into LTL, but I didn't immediately see one.
> 
> This morning I tried the weak fairness constraints (the "-f" argument
> to ./pan) and that did allow LTL to do what I want, as shown in the
> following patch (applied on top of my earlier patch).
> 
> I must confess that LTL is at best an acquired taste for me.
> "Let's see...  '<>[](!reader_done || !updater_done)'...
> That means eventually we always must have neither the reader or the
> updater being done.  Huh???  Oh, yeah, this is supposed to say what
> -cannot- happen..."  At this point, I have an easier time with the
> hand-coded "never" claims.  ;-)
> 
> But I am quite happy to leave further hacking on this model in
> your capable hands.  The other item on my todo list was making the
> urcu_mbmin.spin model accurately handle omission of additional memory
> barriers.  Are you willing to take that on as well?
> 

I'll first get the translation of asserts into LTL formulaes, and try to
see what should be fixed in the model. I have noticed that we would need
to do this :

urcu_gp_ctr = (urcu_gp_ctr + RCU_GP_CTR_BIT) % (RCU_GP_CTR_BIT + 1);

Otherwise the overflow does not do what we expect (spin -f on the trail
told me that it was overflowing to 1, which is not exactly what we want
I guess). More to come on that side. When this will be settled, I'll dig
further.

Mathieu


> 							Thanx, Paul
> 
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> ---
> 
>  urcu.sh   |    4 ++--
>  urcu.spin |   12 ------------
>  2 files changed, 2 insertions(+), 14 deletions(-)
> 
> diff --git a/formal-model/urcu.sh b/formal-model/urcu.sh
> index 5e525ec..3a6850c 100644
> --- a/formal-model/urcu.sh
> +++ b/formal-model/urcu.sh
> @@ -20,6 +20,6 @@
>  #
>  # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>  
> -spin -a urcu.spin 
> +spin -a -f '<>[](!reader_done || !updater_done)' urcu.spin
>  cc -o pan pan.c
> -./pan -a
> +./pan -a -f
> diff --git a/formal-model/urcu.spin b/formal-model/urcu.spin
> index cf1f670..851eb50 100644
> --- a/formal-model/urcu.spin
> +++ b/formal-model/urcu.spin
> @@ -280,15 +280,3 @@ init {
>  		run urcu_updater();
>  	}
>  }
> -
> -/* Require that both reader and updater eventually get done. */
> -
> -never {
> -	do
> -	:: skip;
> -	:: reader_done != 0 || updater_done != 0 -> break;
> -	od;
> -accept:	do
> -	:: reader_done == 0 || updater_done == 0;
> -	od;
> -}
> 

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

  reply	other threads:[~2009-02-20 19:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-20 18:18 [PATCH URCU formal] Add liveness checks to user-level RCU model Mathieu Desnoyers
2009-02-20 19:28 ` Paul E. McKenney
2009-02-20 19:46   ` Mathieu Desnoyers [this message]
2009-02-20 19:53     ` [ltt-dev] " Mathieu Desnoyers
2009-02-20 20:11       ` Paul E. McKenney
2009-02-20 20:09     ` Paul E. McKenney
2009-02-21  1:18       ` Paul E. McKenney
  -- strict thread matches above, loose matches on Subject: below --
2009-02-20 17:39 Paul E. McKenney
2009-02-20 18:44 ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090220194621.GA7349@Krystal \
    --to=compudj@krystal.dyndns.org \
    --cc=bert.wesarg@googlemail.com \
    --cc=bob@watson.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ltt-dev@lists.casi.polymtl.ca \
    --cc=paulmck@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.