Oleg Nesterov fb4214db50 llist: fix/simplify llist_add() and llist_add_batch()
1. This is mostly theoretical, but llist_add*() need ACCESS_ONCE().

   Otherwise it is not guaranteed that the first cmpxchg() uses the
   same value for old_entry and new_last->next.

2. These helpers cache the result of cmpxchg() and read the initial
   value of head->first before the main loop. I do not think this
   makes sense. In the likely case cmpxchg() succeeds, otherwise
   it doesn't hurt to reload head->first.

   I think it would be better to simplify the code and simply read
   ->first before cmpxchg().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andrey Vagin <avagin@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-07-13 13:29:24 +04:00
..
2013-03-13 15:21:48 -07:00
2011-03-11 14:25:50 +00:00
2008-06-06 11:29:10 -07:00
2011-10-29 21:20:22 +02:00
2007-07-17 10:23:04 -07:00
2011-03-31 11:26:23 -03:00
2013-04-30 17:04:09 -07:00
2013-02-27 19:10:09 -08:00
2012-09-30 18:02:20 -07:00
2012-10-06 03:04:57 +09:00
2013-01-17 12:19:09 -08:00
2012-10-09 16:22:40 +09:00
2013-06-18 13:48:45 +02:00
2012-12-17 17:15:22 -08:00
2012-07-30 17:25:16 -07:00
2012-01-31 23:19:47 +02:00
2011-12-08 19:52:43 -05:00
2013-04-29 18:28:42 -07:00
2013-05-29 01:14:46 +02:00