SLUB doesn't require disabled interrupts to call ___cache_free().

Link: 
http://lkml.kernel.org/r/[email protected]
Signed-off-by: Andrey Ryabinin <[email protected]>
Acked-by: Alexander Potapenko <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>

https://jira.sw.ru/browse/PSBM-69081
(cherry picked from commit f7376aed6c032aab820fa36806a89e16e353a0d9)
Signed-off-by: Andrey Ryabinin <[email protected]>
---
 mm/kasan/quarantine.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/mm/kasan/quarantine.c b/mm/kasan/quarantine.c
index 65793f150d1f..4852625ff851 100644
--- a/mm/kasan/quarantine.c
+++ b/mm/kasan/quarantine.c
@@ -147,10 +147,14 @@ static void qlink_free(struct qlist_node *qlink, struct 
kmem_cache *cache)
        struct kasan_alloc_meta *alloc_info = get_alloc_info(cache, object);
        unsigned long flags;
 
-       local_irq_save(flags);
+       if (IS_ENABLED(CONFIG_SLAB))
+               local_irq_save(flags);
+
        alloc_info->state = KASAN_STATE_FREE;
        ___cache_free(cache, object, _THIS_IP_);
-       local_irq_restore(flags);
+
+       if (IS_ENABLED(CONFIG_SLAB))
+               local_irq_restore(flags);
 }
 
 static void qlist_free_all(struct qlist_head *q, struct kmem_cache *cache)
-- 
2.13.5

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to