linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC] a question about mlockall() and mprotect()
@ 2017-09-26  7:56 Xishi Qiu
  2017-09-26  8:17 ` Michal Hocko
  0 siblings, 1 reply; 13+ messages in thread
From: Xishi Qiu @ 2017-09-26  7:56 UTC (permalink / raw)
  To: Michal Hocko, Joonsoo Kim, Vlastimil Babka, Mel Gorman
  Cc: Linux MM, LKML, zhong jiang, yeyunfeng, wanghaitao12,
	Zhoukang (A)

When we call mlockall(), we will add VM_LOCKED to the vma,
if the vma prot is ---p, then mm_populate -> get_user_pages
will not alloc memory.

I find it said "ignore errors" in mm_populate()
static inline void mm_populate(unsigned long addr, unsigned long len)
{
	/* Ignore errors */
	(void) __mm_populate(addr, len, 1);
}

And later we call mprotect() to change the prot, then it is
still not alloc memory for the mlocked vma.

My question is that, shall we alloc memory if the prot changed,
and who(kernel, glibc, user) should alloc the memory?

Thanks,
Xishi Qiu

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-10-10  5:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-26  7:56 [RFC] a question about mlockall() and mprotect() Xishi Qiu
2017-09-26  8:17 ` Michal Hocko
2017-09-26  8:39   ` Xishi Qiu
2017-09-26  9:02     ` Michal Hocko
2017-09-26  9:13       ` Xishi Qiu
2017-09-26  9:18         ` Michal Hocko
2017-09-26  9:22         ` Xishi Qiu
2017-09-26  9:45           ` Vlastimil Babka
2017-09-26 11:00             ` Michal Hocko
2017-09-27  5:51               ` Xishi Qiu
2017-10-09 18:26                 ` Michal Hocko
2017-10-10  1:22                   ` Xishi Qiu
2017-10-10  5:50                     ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).