<html><head></head><body>We should do the 1G block size as a fix, and backport it, and then make the hot unplug code smarter.<br>
<br>
cheers<br><br><div class="gmail_quote">On 8 September 2017 11:15:47 am AEST, Anton Blanchard <anton@ozlabs.org> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Hi Reza,<br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> I may be misunderstanding this, but what if we did something like x86 <br /> does? When trying to unplug a region smaller than the mapping, they<br /> fill that part of the pagetable with 0xFD instead of freeing the<br /> whole thing. Once the whole thing is 0xFD, free it.<br /> <br /> See arch/x86/mm/init_64.c:remove_{pte,pmd,pud}_table()<br /> <br /> ---%<---<br />  memset((void *)addr, PAGE_INUSE, next - addr);<br /> <br />  page_addr = page_address(pte_page(*pte));<br />  if (!memchr_inv(page_addr, PAGE_INUSE, PAGE_SIZE)) {<br />   ...<br />   pte_clear(&init_mm, addr, pte);<br />   ...<br />  }<br /> ---%<---<br /></blockquote><br />But you only have 1GB ptes at this point, you'd need to start<br />instantiating a new level in the tree, and populate 2MB ptes.<br /><br />That is what Ben is suggesting. I'm happy to go any way (fix hotplug<br />to handle this, or increase the memblock size on PowerNV to 1GB), I just<br />need a solution.<br /><br />Anton<br /><br /></pre></blockquote></div><br>
-- <br>
Sent from my Android phone with K-9 Mail. Please excuse my brevity.</body></html>