From: Xishi Qiu <qiuxishi@huawei.com>
To: Linux MM <linux-mm@kvack.org>, LKML <linux-kernel@vger.kernel.org>
Subject: [RFC] mm: why we should clear page when do anonymous page fault
Date: Mon, 22 Feb 2016 10:56:55 +0800 [thread overview]
Message-ID: <56CA78F7.9010201@huawei.com> (raw)
handle_pte_fault()
do_anonymous_page()
alloc_zeroed_user_highpage_movable()
We will alloc a zeroed page when do anonymous page fault, I don't know
why should clear it? just for safe?
If user space program do like the following, there are two memset 0, right?
kernel alloc zeroed page, and user memset 0 it again, this will waste a
lot of time.
main()
{
...
vaddr = malloc(size)
if (vaddr)
memset(vaddr, 0, size);
...
}
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>
WARNING: multiple messages have this Message-ID (diff)
From: Xishi Qiu <qiuxishi@huawei.com>
To: Linux MM <linux-mm@kvack.org>, LKML <linux-kernel@vger.kernel.org>
Subject: [RFC] mm: why we should clear page when do anonymous page fault
Date: Mon, 22 Feb 2016 10:56:55 +0800 [thread overview]
Message-ID: <56CA78F7.9010201@huawei.com> (raw)
handle_pte_fault()
do_anonymous_page()
alloc_zeroed_user_highpage_movable()
We will alloc a zeroed page when do anonymous page fault, I don't know
why should clear it? just for safe?
If user space program do like the following, there are two memset 0, right?
kernel alloc zeroed page, and user memset 0 it again, this will waste a
lot of time.
main()
{
...
vaddr = malloc(size)
if (vaddr)
memset(vaddr, 0, size);
...
}
Thanks,
Xishi Qiu
next reply other threads:[~2016-02-22 2:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-22 2:56 Xishi Qiu [this message]
2016-02-22 2:56 ` [RFC] mm: why we should clear page when do anonymous page fault Xishi Qiu
2016-02-22 3:12 ` Jianyu Zhan
2016-02-22 3:12 ` Jianyu Zhan
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=56CA78F7.9010201@huawei.com \
--to=qiuxishi@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.