aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorChristoph Lameter <cl@linux.com>2011-06-01 13:25:54 -0400
committerPekka Enberg <penberg@kernel.org>2011-07-02 06:26:55 -0400
commit5c2e4bbbd60623f1024a753c291b666068f8a6e7 (patch)
treeb1df70e32d94de20d5c12202250b6e45124435bb /mm
parent881db7fb03a77af0bcd460fd1de1f4062d5c18fe (diff)
slub: Disable interrupts in free_debug processing
We will be calling free_debug_processing with interrupts disabled in some case when the later patches are applied. Some of the functions called by free_debug_processing expect interrupts to be off. Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/slub.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/mm/slub.c b/mm/slub.c
index ee70c091e577..08c57a047548 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1040,6 +1040,10 @@ bad:
1040static noinline int free_debug_processing(struct kmem_cache *s, 1040static noinline int free_debug_processing(struct kmem_cache *s,
1041 struct page *page, void *object, unsigned long addr) 1041 struct page *page, void *object, unsigned long addr)
1042{ 1042{
1043 unsigned long flags;
1044 int rc = 0;
1045
1046 local_irq_save(flags);
1043 slab_lock(page); 1047 slab_lock(page);
1044 1048
1045 if (!check_slab(s, page)) 1049 if (!check_slab(s, page))
@@ -1056,7 +1060,7 @@ static noinline int free_debug_processing(struct kmem_cache *s,
1056 } 1060 }
1057 1061
1058 if (!check_object(s, page, object, SLUB_RED_ACTIVE)) 1062 if (!check_object(s, page, object, SLUB_RED_ACTIVE))
1059 return 0; 1063 goto out;
1060 1064
1061 if (unlikely(s != page->slab)) { 1065 if (unlikely(s != page->slab)) {
1062 if (!PageSlab(page)) { 1066 if (!PageSlab(page)) {
@@ -1077,13 +1081,15 @@ static noinline int free_debug_processing(struct kmem_cache *s,
1077 set_track(s, object, TRACK_FREE, addr); 1081 set_track(s, object, TRACK_FREE, addr);
1078 trace(s, page, object, 0); 1082 trace(s, page, object, 0);
1079 init_object(s, object, SLUB_RED_INACTIVE); 1083 init_object(s, object, SLUB_RED_INACTIVE);
1084 rc = 1;
1085out:
1080 slab_unlock(page); 1086 slab_unlock(page);
1081 return 1; 1087 local_irq_restore(flags);
1088 return rc;
1082 1089
1083fail: 1090fail:
1084 slab_fix(s, "Object at 0x%p not freed", object); 1091 slab_fix(s, "Object at 0x%p not freed", object);
1085 slab_unlock(page); 1092 goto out;
1086 return 0;
1087} 1093}
1088 1094
1089static int __init setup_slub_debug(char *str) 1095static int __init setup_slub_debug(char *str)