]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] memory ordering in __kfifo primitives
authorPaul E. McKenney <paulmck@us.ibm.com>
Fri, 29 Sep 2006 09:00:11 +0000 (02:00 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 29 Sep 2006 16:18:13 +0000 (09:18 -0700)
commitf54898708be4b302ddf15dbb00056a36e5667745
tree3f558e487448db9e49c8d4cd36379d9f42f93da2
parente358e09d3d81cbe0caa4f2e8a1b1ae6a8974d447
[PATCH] memory ordering in __kfifo primitives

Both __kfifo_put() and __kfifo_get() have header comments stating that if
there is but one concurrent reader and one concurrent writer, locking is not
necessary.  This is almost the case, but a couple of memory barriers are
needed.  Another option would be to change the header comments to remove the
bit about locking not being needed, and to change the those callers who
currently don't use locking to add the required locking.  The attachment
analyzes this approach, but the patch below seems simpler.

Signed-off-by: Paul E. McKenney <paulmck@us.ibm.com>
Cc: Stelian Pop <stelian@popies.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/kfifo.c