On Mon, Jan 31, 2011 at 9:59 PM, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote: > On Tue, Feb 1, 2011 at 11:03 AM, Michel Lespinasse <walken@xxxxxxxxxx> wrote: >> >> I am proposing to let mlock ignore vma protection in all cases except >> PROT_NONE. > > What's so special about PROT_NONE? If you want to mlock something > without actually being able to then fault that in, why not? > > IOW, why wouldn't it be right to just make FOLL_FORCE be unconditional in mlock? I agree this would be the most logical thing to do, but I'm afraid people would complain about it as it'd be yet another behavior change. I don't have the entire context here, but PROT_NONE regions are actually common in modern userspace. It seems that for most shared libraries, ld.so creates 4 vmas, one of them being just under 2MB and with PROT_NONE protection. From my shell, if I do cat /proc/$$/maps, I see: [...] 7f41ebdb5000-7f41ebdc5000 r-xp 00000000 fc:03 669498 /usr/lib/zsh/4.3.10/zsh/computil.so 7f41ebdc5000-7f41ebfc4000 ---p 00010000 fc:03 669498 /usr/lib/zsh/4.3.10/zsh/computil.so 7f41ebfc4000-7f41ebfc5000 r--p 0000f000 fc:03 669498 /usr/lib/zsh/4.3.10/zsh/computil.so 7f41ebfc5000-7f41ebfc6000 rw-p 00010000 fc:03 669498 /usr/lib/zsh/4.3.10/zsh/computil.so 7f41ebfc6000-7f41ebfce000 r-xp 00000000 fc:03 669508 /usr/lib/zsh/4.3.10/zsh/parameter.so 7f41ebfce000-7f41ec1ce000 ---p 00008000 fc:03 669508 /usr/lib/zsh/4.3.10/zsh/parameter.so 7f41ec1ce000-7f41ec1cf000 r--p 00008000 fc:03 669508 /usr/lib/zsh/4.3.10/zsh/parameter.so 7f41ec1cf000-7f41ec1d0000 rw-p 00009000 fc:03 669508 /usr/lib/zsh/4.3.10/zsh/parameter.so [...] I don't know why userspace does that, but these regions currently never get any page into RSS, even when processes call mlockall(). I am told that we need to preserve this property. -- Michel "Walken" Lespinasse A program is never fully debugged until the last user dies. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>