<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Martin Doucha <<a href="mailto:mdoucha@suse.cz">mdoucha@suse.cz</a>> wrote:<br></div><div dir="ltr" class="gmail_attr"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail_default" style="font-size:small">...</span><br>
+static void *alloc_zero_page(void *baseaddr)<br>
+{<br>
+ int i;<br>
+ void *ret;<br>
+<br>
+ /* Find aligned chunk of address space. MAP_HUGETLB doesn't work. */<br>
+ for (i = 0; i < 16; i++, baseaddr += thp_size) {<br>
+ ret = mmap(baseaddr, thp_size, PROT_READ,<br>
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">I'm wondering why here request the READ ONLY memory, shouldn't we write something into the write_thp loopingly then?</div></div><div> </div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>