From: Christoph Lameter <cl@linux.com>
To: Pekka Enberg <penberg@kernel.org>
Cc: Joonsoo Kim <js1304@gmail.com>,
David Rientjes <rientjes@google.com>,
Glauber Costa <glommer@parallels.com>,
linux-mm@kvack.org, elezegarcia@gmail.com
Subject: CK5 [1/6] Use correct cpu_slab on dead cpu
Date: Wed, 28 Nov 2012 16:23:00 +0000 [thread overview]
Message-ID: <0000013b47d4167a-f32f2166-dbf4-4ae5-b1b4-284ba72ce445-000000@email.amazonses.com> (raw)
In-Reply-To: <20121128162238.111670741@linux.com>
Pass a kmem_cache_cpu pointer into unfreeze partials so that a different
kmem_cache_cpu structure than the local one can be specified.
V1->V2:
- Improve the comments
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
Index: linux/mm/slub.c
===================================================================
--- linux.orig/mm/slub.c 2012-11-05 09:05:23.572665087 -0600
+++ linux/mm/slub.c 2012-11-05 09:08:04.208740893 -0600
@@ -1869,12 +1869,14 @@ redo:
/*
* Unfreeze all the cpu partial slabs.
*
- * This function must be called with interrupt disabled.
+ * This function must be called with interrupts disabled
+ * for the cpu using c (or some other guarantee must be there
+ * to guarantee no concurrent accesses).
*/
-static void unfreeze_partials(struct kmem_cache *s)
+static void unfreeze_partials(struct kmem_cache *s,
+ struct kmem_cache_cpu *c)
{
struct kmem_cache_node *n = NULL, *n2 = NULL;
- struct kmem_cache_cpu *c = this_cpu_ptr(s->cpu_slab);
struct page *page, *discard_page = NULL;
while ((page = c->partial)) {
@@ -1960,7 +1962,7 @@ static int put_cpu_partial(struct kmem_c
* set to the per node partial list.
*/
local_irq_save(flags);
- unfreeze_partials(s);
+ unfreeze_partials(s, this_cpu_ptr(s->cpu_slab));
local_irq_restore(flags);
oldpage = NULL;
pobjects = 0;
@@ -2003,7 +2005,7 @@ static inline void __flush_cpu_slab(stru
if (c->page)
flush_slab(s, c);
- unfreeze_partials(s);
+ unfreeze_partials(s, c);
}
}
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next parent reply other threads:[~2012-11-28 16:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20121128162238.111670741@linux.com>
2012-11-28 16:23 ` Christoph Lameter [this message]
2012-11-28 16:23 ` CK5 [2/6] slab: Simplify bootstrap Christoph Lameter
2012-11-28 16:23 ` CK5 [4/6] slub: Use a statically allocated kmem_cache boot structure for bootstrap Christoph Lameter
2012-11-28 16:23 ` CK5 [3/6] create common functions for boot slab creation Christoph Lameter
2012-11-28 16:23 ` CK5 [5/6] slab: Use the new create_boot_cache function to simplify bootstrap Christoph Lameter
2012-11-29 9:38 ` Glauber Costa
2012-11-28 16:23 ` CK5 [6/6] Common alignment code Christoph Lameter
2012-11-29 9:42 ` Glauber Costa
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=0000013b47d4167a-f32f2166-dbf4-4ae5-b1b4-284ba72ce445-000000@email.amazonses.com \
--to=cl@linux.com \
--cc=elezegarcia@gmail.com \
--cc=glommer@parallels.com \
--cc=js1304@gmail.com \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
/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