mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sasha Levin <sasha.levin@oracle.com>
To: linux-kernel@vger.kernel.org
Cc: iamjoonsoo.kim@lge.com, cl@linux.com, brouer@redhat.com,
	akpm@linux-foundation.org, Sasha Levin <sasha.levin@oracle.com>
Subject: [PATCH] mm/slub: use unchecked percpu access within preemptible sections
Date: Tue, 20 Jan 2015 23:31:43 -0500	[thread overview]
Message-ID: <1421814703-1869-1-git-send-email-sasha.levin@oracle.com> (raw)

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


             reply	other threads:[~2015-01-21  4:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21  4:31 Sasha Levin [this message]
2015-01-22  1:59 ` Joonsoo Kim
2015-01-22  2:27   ` Sasha Levin
2015-01-22  5:13     ` Joonsoo Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421814703-1869-1-git-send-email-sasha.levin@oracle.com \
    --to=sasha.levin@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=brouer@redhat.com \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®