Message ID | 20220127025542.F0GTnQlNA%akpm@linux-foundation.org |
---|---|
State | New |
Headers | show |
Series | + mm-utilc-make-kvfree-safe-for-calling-while-holding-spinlocks.patch added to -mm tree | expand |
On Thu, 27 Jan 2022 16:45:58 +0100 Manfred Spraul <manfred@colorfullife.com> wrote: > Hi Andrew, > > On 1/27/22 03:55, akpm@linux-foundation.org wrote: > > The patch titled > > Subject: mm/util.c: make kvfree() safe for calling while holding spinlocks > > has been added to the -mm tree. Its filename is > > mm-utilc-make-kvfree-safe-for-calling-while-holding-spinlocks.patch > > > > This patch should soon appear at > > https://ozlabs.org/~akpm/mmots/broken-out/mm-utilc-make-kvfree-safe-for-calling-while-holding-spinlocks.patch > > and later at > > https://ozlabs.org/~akpm/mmotm/broken-out/mm-utilc-make-kvfree-safe-for-calling-while-holding-spinlocks.patch > > Please drop and replace with > > https://marc.info/?l=linux-kernel&m=164132744522325&w=2 > Ah, OK, that's been in -mm and -next for a month. I didn't send it upstream because it wasn't clear to me which way we're going. I'll add cc:stable and send it to Linus this week or next.
--- a/mm/util.c~mm-utilc-make-kvfree-safe-for-calling-while-holding-spinlocks +++ a/mm/util.c @@ -603,12 +603,12 @@ EXPORT_SYMBOL(kvmalloc_node); * It is slightly more efficient to use kfree() or vfree() if you are certain * that you know which one to use. * - * Context: Either preemptible task context or not-NMI interrupt. + * Context: Any context except NMI interrupt. */ void kvfree(const void *addr) { if (is_vmalloc_addr(addr)) - vfree(addr); + vfree_atomic(addr); else kfree(addr); }