Re: dumping the reservation
Re: dumping the reservation
- Subject: Re: dumping the reservation
- From: Bill Angell <email@hidden>
- Date: Wed, 13 Sep 2006 21:23:54 -0700
Shaun,
Is there a definitive spec for what to do about dumping the
ldarx/lwarx reservation on G5 vs G3/G4? I've seen code written four
different ways: [1] my default which was to always dump it to
-8(SP) regardless of CPU type, [2] dump it on G5 only, [3] store the
same data back to the same address, or [4] leave it pending (ignore
without storing) and continue.
The best thing is to dump it into a cache line that you know is not
being used by any other processor, so your default of using the stack
should work fine. I haven't heard of any reason (correctness,
performance, etc.) to conditionalize it based on processor type.
Both the kernel and the user space code use that method almost
exclusively (there are a few special-cased exceptions).
Reservations should never be left dangling. It prevents future
unpaired stwcx. instructions from unexpectedly succeeding and avoids
any potential processor-specific issues as well.
My bias has always been against storing back into the same data. It
will steal the cache line from the processor that is using it,
causing extra bus traffic to get it back. Also, if the other guy has
reserved the memory, it just doesn't seem right for me to be storing
into it, even if it is the same stuff...
Bill
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden