Linux PARISC architecture development
 help / color / mirror / Atom feed
From: John David Anglin <dave.anglin@bell.net>
To: Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>,
	linux-parisc@vger.kernel.org
Subject: Re: Testing the lws_compare_and_swap_2 syscall
Date: Thu, 26 Oct 2017 10:06:25 -0400	[thread overview]
Message-ID: <1ff4bcc7-2e9c-a76c-197c-e19983554818@bell.net> (raw)
In-Reply-To: <1508973952@msgid.manchmal.in-ulm.de>

On 2017-10-25 8:22 PM, Christoph Biedl wrote:
> After staring at lws_compare_and_swap_2 a long time it seems there are
> two issues: First, there is more usage of ",ma" so an update of mem/r26
> hits the wrong place.
The other uses of ",ma" are not a problem as the increment value is 0.  
So, the pointer
is unchanged.  The double word case had an increment of 4 messing up the 
pointer.

Technically, ",ma" with a zero increment provides an ordered load. 
However, the completer
probably isn't necessary as I believe all loads and stores are ordered 
on real hardware.

The "=" completer in the "sub" instructions looks correct to me. When 
*mem and old are
equal, the "b,n     cas2_end" instruction is nullified and new is stored 
in mem.  See comment
from code:

         /*
                 prev = *addr;
                 if ( prev == old )
                   *addr = new;
                 return prev;
         */

In your first test example, old and new should be exchanged in mem. Pass 
should be
mem == new.  Second case should be mem == old.

Dave

-- 
John David Anglin  dave.anglin@bell.net


  reply	other threads:[~2017-10-26 14:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-24 20:03 Testing the lws_compare_and_swap_2 syscall Christoph Biedl
2017-10-25  1:48 ` John David Anglin
2017-10-26  0:22   ` Christoph Biedl
2017-10-26 14:06     ` John David Anglin [this message]
2017-11-06 21:27     ` Helge Deller
2017-11-06 22:45       ` John David Anglin
2017-11-07 21:31         ` John David Anglin
2017-11-07 21:46       ` Christoph Biedl

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=1ff4bcc7-2e9c-a76c-197c-e19983554818@bell.net \
    --to=dave.anglin@bell.net \
    --cc=linux-kernel.bfrz@manchmal.in-ulm.de \
    --cc=linux-parisc@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox