Re: [RFC] mlock/stack guard interaction fixup

From: ijackson
Date: Mon Aug 23 2010 - 12:01:37 EST


Linus Torvalds writes ("Re: [RFC] mlock/stack guard interaction fixup"):
> Although you do need to have some really odd things going on for any
> of them to make any difference. Notably, you need to do mlock or
> mprotect on the stack segment, which no sane program does.

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?)

Locking, including of the stack, is discussed extensively here:
http://www.opengroup.org/onlinepubs/9699919799/xrat/V4_xsh_chap02.html
section "Memory locking functions" subsection "Requirements".

Ian.


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