linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/5] slqb: irq section fix
@ 2009-04-14 16:44 Nick Piggin
  2009-04-14 16:45 ` [patch 2/5] slqb: fix compilation warning Nick Piggin
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Nick Piggin @ 2009-04-14 16:44 UTC (permalink / raw)
  To: Pekka Enberg, Linux Memory Management List


slqb: irq section fix

flush_free_list can be called with interrupts enabled, from
kmem_cache_destroy. Fix this.

Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/mm/slqb.c
===================================================================
--- linux-2.6.orig/mm/slqb.c	2009-04-01 00:57:13.000000000 +1100
+++ linux-2.6/mm/slqb.c	2009-04-01 01:02:02.000000000 +1100
@@ -1087,7 +1087,6 @@ static void slab_free_to_remote(struct k
  */
 static void flush_free_list(struct kmem_cache *s, struct kmem_cache_list *l)
 {
-	struct kmem_cache_cpu *c;
 	void **head;
 	int nr;
 
@@ -1100,8 +1099,6 @@ static void flush_free_list(struct kmem_
 	slqb_stat_inc(l, FLUSH_FREE_LIST);
 	slqb_stat_add(l, FLUSH_FREE_LIST_OBJECTS, nr);
 
-	c = get_cpu_slab(s, smp_processor_id());
-
 	l->freelist.nr -= nr;
 	head = l->freelist.head;
 
@@ -1116,6 +1113,10 @@ static void flush_free_list(struct kmem_
 
 #ifdef CONFIG_SMP
 		if (page->list != l) {
+			struct kmem_cache_cpu *c;
+
+			c = get_cpu_slab(s, smp_processor_id());
+
 			slab_free_to_remote(s, page, object, c);
 			slqb_stat_inc(l, FLUSH_FREE_LIST_REMOTE);
 		} else
@@ -2251,6 +2252,7 @@ void kmem_cache_destroy(struct kmem_cach
 	down_write(&slqb_lock);
 	list_del(&s->list);
 
+	local_irq_disable();
 #ifdef CONFIG_SMP
 	for_each_online_cpu(cpu) {
 		struct kmem_cache_cpu *c = get_cpu_slab(s, cpu);
@@ -2297,6 +2299,7 @@ void kmem_cache_destroy(struct kmem_cach
 
 	free_kmem_cache_nodes(s);
 #endif
+	local_irq_enable();
 
 	sysfs_slab_remove(s);
 	up_write(&slqb_lock);

--
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>

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

end of thread, other threads:[~2009-04-16  9:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-14 16:44 [patch 1/5] slqb: irq section fix Nick Piggin
2009-04-14 16:45 ` [patch 2/5] slqb: fix compilation warning Nick Piggin
2009-04-14 16:46 ` [patch 3/5] slqb: cap remote free list size Nick Piggin
2009-04-14 16:46 ` [patch 4/5] slqb: config slab size Nick Piggin
2009-04-14 16:50 ` [patch 5/5] mm: prompt slqb default for oldconfig Nick Piggin
2009-04-16  8:55   ` Pekka Enberg
2009-04-16  9:22     ` Ingo Molnar
2009-04-16  9:30       ` Nick Piggin
2009-04-16  8:51 ` [patch 1/5] slqb: irq section fix Pekka Enberg

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).