<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 2, 2018 at 8:38 AM, Balbir Singh <span dir="ltr"><<a href="mailto:bsingharora@gmail.com" target="_blank">bsingharora@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">On Thu, Feb 1, 2018 at 11:48 PM, Balbir Singh <<a href="mailto:bsingharora@gmail.com">bsingharora@gmail.com</a>> wrote:<br>
> This patch splits the a linear mapping if the hot-unplug range<br>
> is smaller than the mapping size. The code detects if the mapping<br>
> needs to be split into a smaller size and if so, uses the stop<br>
> machine infrastructure to map the current linear mapping with<br>
> a smaller size mapping. Then the requested area is unmapped.<br>
><br>
> A new API to do a local TLB flush is introduced and exported.<br>
> This API is used in stop mapping after clearing the larger<br>
> mapping and before creating the smaller mapping. There is also<br>
> a check to ensure that we don't overlap with kernel text<br>
> (the region that is being split) as it could cause the executing<br>
> text to fault.<br>
><br>
> There are some caveats with this approach, as the unmapping can<br>
> cause reserved memory area to be freed up (memblock reserved<br>
> mappings and allocations as well), that can be a problem. There<br>
> could be a case where radix__map_kernel_page() may fault if the<br>
> area selected to unmap contains the process page table, this is<br>
> not a new problem created by the patch, but something to watch<br>
> out for while testing. The right approach to solving the hot-unplug<br>
> issue is to make the node/DIMM to be marked hotpluggable so that<br>
> all the memory in that is movable. Currently there is no method<br>
> of enforcing the hotpluggable property via libvirt or qemu.</div></div></blockquote></div><br></div><div class="gmail_extra">In fact QEMU presents all the hotpluggable memory to the guest via ibm,dynamic-reconfiguration-memory DT node. So guest kernel can easily mark them as hotpluggable and that is what I tried in my earlier attempts. However that won't fly with PowerVM for the reason described in <a href="https://patchwork.ozlabs.org/patch/856015/">https://patchwork.ozlabs.org/patch/856015/</a><br><br></div><div class="gmail_extra">Regards,<br></div><div class="gmail_extra">Bharata.<br></div></div>