diff options
author | Christoph Lameter <cl@linux.com> | 2011-06-01 13:25:54 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2011-07-02 06:26:55 -0400 |
commit | 5c2e4bbbd60623f1024a753c291b666068f8a6e7 (patch) | |
tree | b1df70e32d94de20d5c12202250b6e45124435bb /mm | |
parent | 881db7fb03a77af0bcd460fd1de1f4062d5c18fe (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.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -1040,6 +1040,10 @@ bad: | |||
1040 | static noinline int free_debug_processing(struct kmem_cache *s, | 1040 | static 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; | ||
1085 | out: | ||
1080 | slab_unlock(page); | 1086 | slab_unlock(page); |
1081 | return 1; | 1087 | local_irq_restore(flags); |
1088 | return rc; | ||
1082 | 1089 | ||
1083 | fail: | 1090 | fail: |
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 | ||
1089 | static int __init setup_slub_debug(char *str) | 1095 | static int __init setup_slub_debug(char *str) |