From: Xishi Qiu <qiuxishi@huawei.com>
To: Michal Hocko <mhocko@kernel.org>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Vlastimil Babka <vbabka@suse.cz>,
Mel Gorman <mgorman@techsingularity.net>
Cc: Linux MM <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>,
zhong jiang <zhongjiang@huawei.com>,
yeyunfeng <yeyunfeng@huawei.com>,
wanghaitao12@huawei.com, "Zhoukang (A)" <zhoukang7@huawei.com>
Subject: [RFC] a question about mlockall() and mprotect()
Date: Tue, 26 Sep 2017 15:56:55 +0800 [thread overview]
Message-ID: <59CA0847.8000508@huawei.com> (raw)
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>
next reply other threads:[~2017-09-26 8:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-26 7:56 Xishi Qiu [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=59CA0847.8000508@huawei.com \
--to=qiuxishi@huawei.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@kernel.org \
--cc=vbabka@suse.cz \
--cc=wanghaitao12@huawei.com \
--cc=yeyunfeng@huawei.com \
--cc=zhongjiang@huawei.com \
--cc=zhoukang7@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox