linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Li Yang" <LeoLi@freescale.com>
To: linuxppc-embedded@ozlabs.org
Subject: RE: atomic operations in user space
Date: Tue, 29 Aug 2006 21:37:37 +0800	[thread overview]
Message-ID: <a0bc9bf80608290637q165d1f54x2d80e771671c894f@mail.gmail.com> (raw)

> This is exactly how it is supposed to work! That's why there is a loop
> in the atomic increment - you check if you still had the reservation
> after the transaction by checking the result from the stwcx, and if not,
> retry.

I surely know all the theories you mentioned clearly.  But please do
look at the case I gave.  Correct me if I missed anything.  Thanks

All the lwarx and stwcx operate on the same address.

> Task A		Task B
> lwarx				
// Get RESERVATION
> 			......
> 			lwarx
> 			stwcx

// RESERVATION cleared
>
> 			.....
> 			.....
> 			lwarx

// Get RESERVATION again
> stwcx				

//Note here: RESERVATION is valid, address is the same.
So the result is commited, no retry for task A

> .....
> 			stwcx
//RESERVATION is cleared, retry atomic op for task B

Please be noted that reservation is only identified by reservation bit
and address operated on.  So different lwarx's on the same address,
may be considered as the same reservation.

             reply	other threads:[~2006-08-29 13:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-29 13:37 Li Yang [this message]
2006-08-29 16:05 ` atomic operations in user space Esben Nielsen
2006-08-29 17:00   ` Li Yang
  -- strict thread matches above, loose matches on Subject: below --
2006-08-30  2:17 Liu Dave-r63238
2006-08-30  2:27 ` Liu Dave-r63238
2006-08-30  2:40   ` Li Yang-r58472
2006-08-29  0:43 Xupei Liang
2006-08-29  6:43 ` Li Yang-r58472
2006-08-29  8:33   ` Esben Nielsen
2006-08-29  8:54     ` Li Yang-r58472
2006-08-29  9:20       ` Liu Dave-r63238
2006-08-29  9:56         ` Esben Nielsen
2006-08-29 10:05           ` Liu Dave-r63238
2006-08-29 10:52           ` Li Yang-r58472
2006-08-29 11:26             ` Esben Nielsen
2006-08-29 11:30               ` Esben Nielsen
2006-08-29 12:36             ` Brent Cook
2006-08-23 19:03 Terry Liang
2006-08-24 10:39 ` Li Yang-r58472
2006-08-24 14:18   ` Brent Cook
2006-08-25  2:33     ` Li Yang-r58472
2006-08-22 20:50 Xupei Liang
2006-08-22 22:23 ` Arnd Bergmann

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=a0bc9bf80608290637q165d1f54x2d80e771671c894f@mail.gmail.com \
    --to=leoli@freescale.com \
    --cc=linuxppc-embedded@ozlabs.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;
as well as URLs for NNTP newsgroup(s).