linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC] mm: why we should clear page when do anonymous page fault
@ 2016-02-22  2:56 Xishi Qiu
  2016-02-22  3:12 ` Jianyu Zhan
  0 siblings, 1 reply; 2+ messages in thread
From: Xishi Qiu @ 2016-02-22  2:56 UTC (permalink / raw)
  To: Linux MM, LKML

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>

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

end of thread, other threads:[~2016-02-22  3:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox