diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2025-11-13 11:42:44 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2025-11-13 11:42:44 -0800 |
| commit | 9b9e43704d2b05514aeeaea36311addba2c72408 (patch) | |
| tree | cfd0ba9252ac273363169b66651999727985ce35 /mm/slub.c | |
| parent | 8b4a014e2865a970c18c1e9bba2b5c5a7322045f (diff) | |
| parent | cbcff934fa7deb670d9545a3aad4d07e8f1e4f3c (diff) | |
Merge tag 'slab-for-6.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab
Pull slab fix from Vlastimil Babka:
- Fix memory leak of objects from remote NUMA node when bulk freeing to
a cache with sheaves (Harry Yoo)
* tag 'slab-for-6.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab:
mm/slub: fix memory leak in free_to_pcs_bulk()
Diffstat (limited to 'mm/slub.c')
| -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 1bf65c421325..a0b905c2a557 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -6336,8 +6336,6 @@ next_remote_batch: if (unlikely(!slab_free_hook(s, p[i], init, false))) { p[i] = p[--size]; - if (!size) - goto flush_remote; continue; } @@ -6352,6 +6350,9 @@ next_remote_batch: i++; } + if (!size) + goto flush_remote; + next_batch: if (!local_trylock(&s->cpu_sheaves->lock)) goto fallback; @@ -6406,6 +6407,9 @@ do_free: goto next_batch; } + if (remote_nr) + goto flush_remote; + return; no_empty: |