Re: dumping the reservation
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Shaun, Bill _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... 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... This email sent to site_archiver@lists.apple.com
participants (1)
-
Bill Angell