diff --git a/init/Kconfig b/init/Kconfig index d94fbe79c35477c92de9afe6e671e5be347d3916..78ba2cfbfeef295c474263613acb1b3ccf6236fa 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1800,7 +1800,7 @@ config SLAB_FREELIST_HARDENED config SLUB_CPU_PARTIAL default y - depends on SLUB && SMP + depends on SLUB && SMP && !PREEMPT_RT_FULL bool "SLUB per cpu partial cache" help Per cpu partial caches accellerate objects allocation and freeing diff --git a/mm/slub.c b/mm/slub.c index 7acc32253e90d7f4fa8500502f18e40ff96879b0..1daa6ef4c2dc20ed67625614739a0536e70ab4dd 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1589,10 +1589,17 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) void *start, *p; int idx, order; bool shuffle; + bool enableirqs = false; flags &= gfp_allowed_mask; if (gfpflags_allow_blocking(flags)) + enableirqs = true; +#ifdef CONFIG_PREEMPT_RT_FULL + if (system_state > SYSTEM_BOOTING) + enableirqs = true; +#endif + if (enableirqs) local_irq_enable(); flags |= s->allocflags; @@ -1651,7 +1658,7 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) page->frozen = 1; out: - if (gfpflags_allow_blocking(flags)) + if (enableirqs) local_irq_disable(); if (!page) return NULL; @@ -3707,6 +3714,11 @@ static void list_slab_objects(struct kmem_cache *s, struct page *page, const char *text) { #ifdef CONFIG_SLUB_DEBUG +#ifdef CONFIG_PREEMPT_RT_BASE + /* XXX move out of irq-off section */ + slab_err(s, page, text, s->name); +#else + void *addr = page_address(page); void *p; unsigned long *map = kcalloc(BITS_TO_LONGS(page->objects), @@ -3728,6 +3740,7 @@ static void list_slab_objects(struct kmem_cache *s, struct page *page, slab_unlock(page); kfree(map); #endif +#endif } /*