linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Esben Nielsen <nielsen.esben@gogglemail.com>
To: Li Yang <LeoLi@freescale.com>
Cc: linuxppc-embedded@ozlabs.org
Subject: RE: atomic operations in user space
Date: Tue, 29 Aug 2006 18:05:43 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0608291804260.22067@frodo.shire> (raw)
In-Reply-To: <a0bc9bf80608290637q165d1f54x2d80e771671c894f@mail.gmail.com>



On Tue, 29 Aug 2006, Li Yang wrote:

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

Now we do a task switch involving atomic operations, and thus an 
reservation on another address.

>> 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.
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>

  reply	other threads:[~2006-08-29 16:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-29 13:37 atomic operations in user space Li Yang
2006-08-29 16:05 ` Esben Nielsen [this message]
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=Pine.LNX.4.64.0608291804260.22067@frodo.shire \
    --to=nielsen.esben@gogglemail.com \
    --cc=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).