Files
kernel_xiaomi_sm8250/include/linux
Herbert Xu b24d18aa74 [PATCH] list: add missing rcu_dereference on first element
It seems that all the list_*_rcu primitives are missing a memory barrier
on the very first dereference.  For example,

#define list_for_each_rcu(pos, head) \
	for (pos = (head)->next; prefetch(pos->next), pos != (head); \
		pos = rcu_dereference(pos->next))

It will go something like:

	pos = (head)->next

	prefetch(pos->next)

	pos != (head)

	do stuff

We're missing a barrier here.

	pos = rcu_dereference(pos->next)

		fetch pos->next

		barrier given by rcu_dereference(pos->next)

		store pos

Without the missing barrier, the pos->next value may turn out to be stale.
In fact, if "do stuff" were also dereferencing pos and relying on
list_for_each_rcu to provide the barrier then it may also break.

So here is a patch to make sure that we have a barrier for the first
element in the list.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-17 08:59:10 -07:00
..
2005-09-13 08:22:31 -07:00
2005-08-25 12:40:44 -04:00
2005-08-29 15:59:42 -04:00
2005-09-07 16:57:21 -07:00
2005-10-04 13:22:01 -07:00
2005-10-08 15:00:57 -07:00
2005-09-10 10:06:21 -07:00
2005-09-10 10:16:27 -07:00
2005-09-05 00:06:09 -07:00
2005-09-07 16:57:21 -07:00
2005-09-13 08:22:32 -07:00
2005-09-09 13:57:55 -07:00
2005-09-13 08:22:32 -07:00
2005-10-08 15:00:57 -07:00
2005-09-05 09:14:13 -07:00
2005-08-29 16:01:32 -07:00
2005-08-29 16:01:32 -07:00
2005-09-19 15:41:28 -07:00
2005-08-29 16:01:32 -07:00
2005-08-29 15:49:46 -07:00
2005-09-09 20:14:47 -05:00
2005-08-29 15:43:19 -07:00
2005-09-07 16:57:48 -07:00
2005-10-03 14:13:38 -07:00
2005-10-08 15:00:57 -07:00
2005-09-17 11:50:02 -07:00
2005-10-08 15:00:57 -07:00
2005-08-29 16:01:32 -07:00
2005-08-29 16:01:32 -07:00
2005-08-28 20:28:25 -04:00
2005-09-07 16:57:24 -07:00
2005-09-13 08:22:31 -07:00
2005-08-30 22:48:51 -05:00
2005-09-09 13:57:54 -07:00
2005-09-09 13:57:54 -07:00
2005-09-07 16:57:18 -07:00
2005-10-08 15:00:57 -07:00
2005-08-29 16:01:32 -07:00
2005-09-10 10:06:21 -07:00
2005-09-10 10:06:21 -07:00
2005-10-08 15:00:57 -07:00
2005-09-05 00:05:45 -07:00
2005-09-18 00:18:32 -07:00
2005-09-10 10:06:36 -07:00
2005-09-07 16:57:34 -07:00
2005-09-09 13:57:58 -07:00
2005-10-08 15:00:57 -07:00