Revision 4f988f152ee087831ea5c1c77cda4454cacc052c authored by Linus Torvalds on 04 May 2012, 22:13:54 UTC, committed by Linus Torvalds on 04 May 2012, 22:13:54 UTC
The normal read_seqcount_begin() function will wait for any current writers to exit their critical region by looping until the sequence count is even. That "wait for sequence count to stabilize" is the right thing to do if the read-locker will just retry the whole operation on contention: no point in doing a potentially expensive reader sequence if we know at the beginning that we'll just end up re-doing it all. HOWEVER. Some users don't actually retry the operation, but instead will abort and do the operation with proper locking. So the sequence count case may be the optimistic quick case, but in the presense of writers you may want to do full locking in order to guarantee forward progress. The prime example of this would be the RCU name lookup. And in that case, you may well be better off without the "retry early", and are in a rush to instead get to the failure handling. Thus this "raw" interface that just returns the sequence number without testing it - it just forces the low bit to zero so that read_seqcount_retry() will always fail such a "active concurrent writer" scenario. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 2f62427
File | Mode | Size |
---|---|---|
apparmor | ||
integrity | ||
keys | ||
selinux | ||
smack | ||
tomoyo | ||
yama | ||
Kconfig | -rw-r--r-- | 8.0 KB |
Makefile | -rw-r--r-- | 1.0 KB |
capability.c | -rw-r--r-- | 23.3 KB |
commoncap.c | -rw-r--r-- | 27.3 KB |
device_cgroup.c | -rw-r--r-- | 11.4 KB |
inode.c | -rw-r--r-- | 6.7 KB |
lsm_audit.c | -rw-r--r-- | 9.2 KB |
min_addr.c | -rw-r--r-- | 1.3 KB |
security.c | -rw-r--r-- | 32.9 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...