All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] slub: correctly bootstrap boot caches
@ 2013-02-22 16:20 ` Glauber Costa
  0 siblings, 0 replies; 30+ messages in thread
From: Glauber Costa @ 2013-02-22 16:20 UTC (permalink / raw)
  To: linux-mm-Bw31MaZKKs3YtjvyW6yDsg
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	cgroups-u79uwXL29TY76Z2rM5mHXA, Glauber Costa, Christoph Lameter,
	Andrew Morton, Tejun Heo, Pekka Enberg

After we create a boot cache, we may allocate from it until it is bootstraped.
This will move the page from the partial list to the cpu slab list. If this
happens, the loop:

	list_for_each_entry(p, &n->partial, lru)

that we use to scan for all partial pages will yield nothing, and the pages
will keep pointing to the boot cpu cache, which is of course, invalid. To do
that, we should flush the cache to make sure that the cpu slab is back to the
partial list.

Signed-off-by: Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
Reported-by:  Steffen Michalke <StMichalke-S0/GAf8tV78@public.gmane.org>
Tested-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
Cc: Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
Cc: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Cc: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Pekka Enberg <penberg-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

 mm/slub.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
---
 mm/slub.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/mm/slub.c b/mm/slub.c
index ba2ca53..31a494c 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3617,6 +3617,12 @@ static struct kmem_cache * __init bootstrap(struct kmem_cache *static_cache)
 
 	memcpy(s, static_cache, kmem_cache->object_size);
 
+	/*
+	 * This runs very early, and only the boot processor is supposed to be
+	 * up.  Even if it weren't true, IRQs are not up so we couldn't fire
+	 * IPIs around.
+	 */
+	__flush_cpu_slab(s, smp_processor_id());
 	for_each_node_state(node, N_NORMAL_MEMORY) {
 		struct kmem_cache_node *n = get_node(s, node);
 		struct page *p;
-- 
1.8.1.2

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

end of thread, other threads:[~2013-02-27 16:39 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-22 16:20 [PATCH v2] slub: correctly bootstrap boot caches Glauber Costa
2013-02-22 16:20 ` Glauber Costa
2013-02-22 16:20 ` Glauber Costa
2013-02-22 16:34 ` Christoph Lameter
2013-02-22 16:34   ` Christoph Lameter
     [not found] ` <alpine.DEB.2.02.1302221034380.7600@gentwo.org>
     [not found]   ` <alpine.DEB.2.02.1302221034380.7600-gkYfJU5Cukgdnm+yROfE0A@public.gmane.org>
2013-02-22 17:00     ` Christoph Lameter
2013-02-22 17:00       ` Christoph Lameter
2013-02-22 17:00       ` Christoph Lameter
     [not found]   ` <alpine.DEB.2.02.1302221057430.7600@gentwo.org>
2013-02-22 17:01     ` Christoph Lameter
2013-02-22 17:01       ` Christoph Lameter
2013-02-22 17:08       ` Glauber Costa
2013-02-22 17:08         ` Glauber Costa
2013-02-22 17:23         ` Christoph Lameter
2013-02-22 17:23           ` Christoph Lameter
2013-02-22 23:20           ` JoonSoo Kim
2013-02-22 23:20             ` JoonSoo Kim
2013-02-24  0:35             ` Christoph Lameter
2013-02-24  0:35               ` Christoph Lameter
     [not found]               ` <0000013d09a01f03-376fad0e-700d-4a04-8da2-89e6b3a22408-000000-p/GC64/jrecnJqMo6gzdpkEOCMrvLtNR@public.gmane.org>
2013-02-25  5:16                 ` Joonsoo Kim
2013-02-25  5:16                   ` Joonsoo Kim
2013-02-25  5:16                   ` Joonsoo Kim
     [not found]           ` <0000013d02ee5bf7-a2d47cfc-64fb-4faa-b92e-e567aeb6b587-000000-p/GC64/jrecnJqMo6gzdpkEOCMrvLtNR@public.gmane.org>
2013-02-27  7:47             ` Pekka Enberg
2013-02-27  7:47               ` Pekka Enberg
2013-02-27  7:47               ` Pekka Enberg
     [not found]               ` <CAOJsxLFzrw0pCzUG7Ru4dB9=aPoNKHiJ_y3bopiFvBhzV9A5Zg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-27 13:46                 ` Glauber Costa
2013-02-27 13:46                   ` Glauber Costa
2013-02-27 13:46                   ` Glauber Costa
     [not found]                   ` <512E0E53.9010908-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2013-02-27 16:39                     ` Christoph Lameter
2013-02-27 16:39                       ` Christoph Lameter
2013-02-27 16:39                       ` Christoph Lameter

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.