diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-01-21 09:19:15 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-01-21 09:19:15 -0800 |
| commit | 119d1cbc6ee3c72620b1ab24dc3c89de31981d82 (patch) | |
| tree | 509293fdb75b344d6e4607613ee32ae074827efd /mm | |
| parent | 07eebd934c9cb9f12f589ea5b826fa7ca056cb4d (diff) | |
| parent | 99a3e3a1cfc93b8fe318c0a3a5cfb01f1d4ad53c (diff) | |
| download | linux-next-119d1cbc6ee3c72620b1ab24dc3c89de31981d82.tar.gz linux-next-119d1cbc6ee3c72620b1ab24dc3c89de31981d82.zip | |
Merge tag 'slab-for-6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab
Pull slab fix from Vlastimil Babka:
- A stable fix for kmalloc_nolock() in non-preemptible contexts on
PREEMPT_RT (Swaraj Gaikwad)
* tag 'slab-for-6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab:
slab: fix kmalloc_nolock() context check for PREEMPT_RT
Diffstat (limited to 'mm')
| -rw-r--r-- | mm/slub.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/slub.c b/mm/slub.c index 861592ac5425..f77b7407c51b 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -5694,8 +5694,12 @@ void *kmalloc_nolock_noprof(size_t size, gfp_t gfp_flags, int node) if (unlikely(!size)) return ZERO_SIZE_PTR; - if (IS_ENABLED(CONFIG_PREEMPT_RT) && (in_nmi() || in_hardirq())) - /* kmalloc_nolock() in PREEMPT_RT is not supported from irq */ + if (IS_ENABLED(CONFIG_PREEMPT_RT) && !preemptible()) + /* + * kmalloc_nolock() in PREEMPT_RT is not supported from + * non-preemptible context because local_lock becomes a + * sleeping lock on RT. + */ return NULL; retry: if (unlikely(size > KMALLOC_MAX_CACHE_SIZE)) |
