On Wed, 27 Jun 2007, Nick Piggin wrote:Oh, that releasing "add" can be unlocked, and only the holder of the lock ever touches that field? I must not have looked closely enough. In that case, I withdraw that objection, and the sequence-number-based spinlock sounds like a perfectly fine one. Yes, the add will be slightly slower than the plain byte move, and the locked xadd will be slightly slower than a regular locked add, but compared to the serialization cost, that should be small. For some reason I thought you needed a locked instruction for the unlock too. So try it with just a byte counter, and test some stupid micro-benchmark on both a P4 and a Core 2 Duo, and if it's in the noise, maybe we can make it the normal spinlock sequence just because it isn't noticeably slower. In fact, I think a "incb <mem>" instruction is even a byte shorter than "movb $1,mem", and with "unlock" being inlined, that could actually be a slight _win_. Linus -
| Bruce Leonard | [PATCH 2/2][MTD] Add support for > 2GiB MTD devices |
| Benjamin Herrenschmidt | Re: [PATCH 0 of 4] Generic AIO by scheduling stacks |
| Rafael J. Wysocki | [Bug #11264] Invalid op opcode in kernel/workqueue |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
git: | |
| Elijah Newren | Trying to use git-filter-branch to compress history by removing large, obsolete bi... |
| David Woodhouse | Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins |
| Florian Weimer | Re: comparing file contents in is_exact_match? |
| sean | Adding color to git diff output. |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| David Newman | setting dscp or tos bits |
| Richard Stallman | Real men don't attack straw men |
| alemao | Azalia - Realtek/0x0885 - plays, but no sound |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| Doug Evans | Re: Stabilizing Linux |
| Stephen Tweedie | Re: No utmp entry. You must exec "login" from lowest level "sh" |
| Maurizio Codogno | SLS 0.99.2 mount problems |
