[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1479474236-4139-8-git-send-email-hch@lst.de>
Date: Fri, 18 Nov 2016 14:03:53 +0100
From: Christoph Hellwig <hch@....de>
To: akpm@...ux-foundation.org
Cc: aryabinin@...tuozzo.com, joelaf@...gle.com, jszhang@...vell.com,
chris@...is-wilson.co.uk, joaodias@...gle.com, linux-mm@...ck.org,
linux-rt-users@...r.kernel.org, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 07/10] mm: warn about vfree from atomic context
We can't handle vfree itself from atomic context, but callers
can explicitly use vfree_atomic instead, which defers the actual
vfree to a workqueue. Unfortunately in_atomic does not work
on non-preemptible kernels, so we can't just do the right thing
by default.
Signed-off-by: Christoph Hellwig <hch@....de>
---
mm/vmalloc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 80f3fae..e2030b4 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1530,6 +1530,7 @@ void vfree_atomic(const void *addr)
void vfree(const void *addr)
{
BUG_ON(in_nmi());
+ WARN_ON_ONCE(in_atomic());
kmemleak_free(addr);
--
2.1.4
Powered by blists - more mailing lists