lkml.org 
[lkml]   [2010]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC] mlock/stack guard interaction fixup
From
Peter Zijlstra writes ("Re: [RFC] mlock/stack guard interaction fixup"):
> On Mon, 2010-08-23 at 16:42 +0100, ijackson@chiark.greenend.org.uk
> wrote:
> > mlocking the stack is entirely sensible and normal for a real-time
> > program. Most such programs use mlockall but there is no particular
> > reason why a program that has some more specific requirements should
> > use mlock to lock only a part of the stack. (Perhaps it has only one
> > real-time thread?)
>
> RT apps should pre-allocate and mlock their stack in advance (and
> pre-fault too for the paranoid).

Are you allowed to mlock a stack page which has not yet been faulted
in ? What effect does it have ? I wasn't able to find a convincing
de jure answer to this question.

But you seem, like me, to be disagreeing with Linus's assertion that
calling mlock() on the stack is something no sane programs does ?

> mlockall is a very bad interface and should really not be used.

You are directly contradicting the advice in SuS, to which I just gave
a reference. You're free to do so of course but it might be worth
explaining in a bit more detail why the advice in SuS is wrong.

Ian.


\
 
 \ /
  Last update: 2010-08-23 19:21    [W:0.089 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site