On 06/15/2012 09:22 PM, Jeff Weber wrote:
> On Fri, Jun 15, 2012 at 2:16 PM, Gilles Chanteperdrix <
> [email protected]> wrote:
> 
>> On 06/15/2012 09:12 PM, Jeff Weber wrote:
>>> I occasionally run across net lore which recommends "pre-faulting" a
>> stack.
>>>  For example:
>>>
>> https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO#A_Realtime_.22Hello_World.22_Example
>>>
>>> From my understanding of mlockall(MCL_CURRENT|MCL_FUTURE), all process
>>> memory is paged and locked in.  Thus, a pre-faulting exercise appears
>>> useless.
>>> (I don't care about the main() thread.)  Can you confirm?
>>
>> Last time I checked, only the main thread stack was grown on demand, so
>> required pre-faulting the stack, which is why xenomai takes care of
>> pre-faulting the main thread stack.
>>
>> To verify this, you have to check /proc/self/maps. If the thread stack
>> belongs to a mapping of a size you would not expect, try writing below
>> the limit, to see if you get a fault, or if the mapping grows in
>> /proc/self/maps.
> 
> 
> Shouldn't those cases be covered by MCL_FUTURE?

MCL_FUTURE will prevent the memory from being swapped out as soon as the
stack is grown, but the stack is grown upon page fault. How else would
you detect that the stack needs to be grown ?

-- 
                                                                Gilles.

_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai

Reply via email to