Re: Q: behaviour of mlockall(MCL_FUTURE) and VM_GROWSDOWN segments

Andrew Morton (akpm@zip.com.au)
Fri, 11 Jan 2002 17:04:37 -0800


Andi Kleen wrote:
>
> Andrew Morton <akpm@zip.com.au> writes:
>
> > So in this case, the behaviour I would prefer is MCL_FUTURE for
> > all vma's *except* the stack. Stack pages should be locked
> > only when they are faulted in. Hard call.
>
> There is just one problem: linuxthread stacks are just ordinary mappings
> and they are in no way special to the kernel; they aren't VM_GROWSDOWN.
> You would need to add a way to the kernel first to tag the linux thread
> stacks in a way that is recognizable to mlockall and then do that
> from linuxthreads.
>
> I think for the normal stack - real VM_GROWSDOWN segments - mlockall
> already does the right thing.

hmm.. So I wonder what changed between 2.4.7 and 2.4.15 which unbroke
MCL_FUTURE.

I suspect we can fix the problem by running mlockall(MCL_FUTURE)
and then an explicit munlock() of the stack area.

-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/