linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] rculist: Fix list_entry_rcu to read ptr with, rcu_dereference_raw
@ 2015-03-24 10:31 Patrick Marlier
  0 siblings, 0 replies; only message in thread
From: Patrick Marlier @ 2015-03-24 10:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul E. McKenney, Josh Triplett, Arnd Bergmann

Hi Paul and Josh,

While running some benchmarks with rcu, I noticed that rculist had a 
performance issue compared to the non-rcu list.
Having a closer look at the rlulist, I found that there is a bad usage 
of rcu_dereference_raw in list_entry_rcu().
Indeed, "typeof (*ptr) *__ptr = ptr;" reads ptr and 
"rcu_dereference_raw(__ptr)" forces read on the stack variable __ptr.
However, ptr should be read with rcu_dereference_raw not the __ptr.

This was introduced some years ago with commit 67bdbffd (2010-02-25).
I am proposing to revert this part of the patch but probably this can be 
fixed differently.

Fixing this showed 2 problems in the usage of list_entry_rcu.
Since it touches other parts of kernel, I guess it requires ack from 
other maintainers.

Thanks.

PS: I will Cc the others maintainers when somebody confirms the problem.

Signed-off-by: Patrick Marlier <patrick.marlier@gmail.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-24 10:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-24 10:31 [PATCH 0/3] rculist: Fix list_entry_rcu to read ptr with, rcu_dereference_raw Patrick Marlier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).