Thread (24 messages) 24 messages, 8 authors, 2016-11-08

Re: [PATCH 2/6] mm: mark all calls into the vmalloc subsystem as potentially sleeping

From: Joel Fernandes <hidden>
Date: 2016-10-21 00:32:25
Also in: linux-mm, lkml

Hi Christoph,

On Wed, Oct 19, 2016 at 9:31 AM, Christoph Hellwig [off-list ref] wrote:
quoted hunk ↗ jump to hunk
On Wed, Oct 19, 2016 at 08:34:40AM -0700, Andy Lutomirski wrote:
quoted
It would be quite awkward for a task stack to get freed from a
sleepable context, because the obvious sleepable context is the task
itself, and it still needs its stack.  This was true even in the old
regime when task stacks were freed from RCU context.

But vfree has a magic automatic deferral mechanism.  Couldn't you make
the non-deferred case might_sleep()?
But it's only magic from interrupt context..

Chris, does this patch make virtually mapped stack work for you again?
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index f2481cb..942e02d 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1533,7 +1533,7 @@ void vfree(const void *addr)

        if (!addr)
                return;
-       if (unlikely(in_interrupt())) {
+       if (in_interrupt() || in_atomic()) {
in_atomic() also checks in_interrupt() cases so only in_atomic() should suffice.

Thanks,

Joel

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help