All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/slub: use unchecked percpu access within preemptible sections
@ 2015-01-21  4:31 Sasha Levin
  2015-01-22  1:59 ` Joonsoo Kim
  0 siblings, 1 reply; 4+ messages in thread
From: Sasha Levin @ 2015-01-21  4:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: iamjoonsoo.kim, cl, brouer, akpm, Sasha Levin

Commit "mm/slub: optimize alloc/free fastpath by removing preemption on/off"
has added access to percpu memory while the code is preemptible.

While those accesses are okay, this creates a huge amount of warnings from
the code that checks for that.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 mm/slub.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 907fabe..9b72b9c 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2431,8 +2431,8 @@ redo:
 	 * to check if it is matched or not.
 	 */
 	do {
-		tid = this_cpu_read(s->cpu_slab->tid);
-		c = this_cpu_ptr(s->cpu_slab);
+		tid = raw_cpu_read(s->cpu_slab->tid);
+		c = raw_cpu_ptr(s->cpu_slab);
 	} while (IS_ENABLED(CONFIG_PREEMPT) && unlikely(tid != c->tid));
 
 	/*
@@ -2700,8 +2700,8 @@ redo:
 	 * during the cmpxchg then the free will succedd.
 	 */
 	do {
-		tid = this_cpu_read(s->cpu_slab->tid);
-		c = this_cpu_ptr(s->cpu_slab);
+		tid = raw_cpu_read(s->cpu_slab->tid);
+		c = raw_cpu_ptr(s->cpu_slab);
 	} while (IS_ENABLED(CONFIG_PREEMPT) && unlikely(tid != c->tid));
 
 	/* Same with comment on barrier() in slab_alloc_node() */
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-22  5:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-21  4:31 [PATCH] mm/slub: use unchecked percpu access within preemptible sections Sasha Levin
2015-01-22  1:59 ` Joonsoo Kim
2015-01-22  2:27   ` Sasha Levin
2015-01-22  5:13     ` Joonsoo Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.