<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 2, 2018 at 7:51 AM, David Gibson <span dir="ltr"><<a href="mailto:david@gibson.dropbear.id.au" target="_blank">david@gibson.dropbear.id.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Feb 23, 2018 at 03:02:40PM +0530, Bharata B Rao wrote:<br>
> Hi,<br>
><br>
> Rebooting a hash guest after hotplugging memory to it is crashing the<br>
> guest. This is seen only when HPT resizing is enabled. I see guest crashing<br>
> at multiple places, but this location is fairly commonly seen:<br>
><br>
> kernel BUG at mm/slub.c:3912!<br>
><br>
> Testing with latest guest kernel and ppc-for-2.12 branch of QEMU.<br>
<br>
</span>Ugh.  We had several bugs along these lines, but I thought I'd fixed<br>
them.  I wonder what this one is.<br>
<span class=""><br>
> A bit of debugging shows me that when memory is added, the guest kernel<br>
> tries to resize HPT to a htab_shift value lesser than the value with which<br>
> the guest has booted. For eg. a 8GB guest boots with htab_shift of 26. When<br>
> 1G is hot-added,<br>
> arch/powerpc/mm/hash_utils_64.<wbr>c:resize_hpt_for_hotplug() ends up assigning<br>
> 24 to target_hpt_shift. This looks suspicious as we are increasing the<br>
> memory, but kernel is asking for shrinking the HPT size.<br>
<br>
</span>So the shrink-HPT-on-add-memory is actually expected and should be<br>
harmless.  It occurs because qemu estimates HPT size on the<br>
traditional HPT == RAM size / 64 formular, which was devised with 4k<br>
pages in mind.  The kernel on the other hand, knows it is using 64k<br>
pages and so estimates a smaller HPT size.  Hot plugging memory always<br>
prompts the guest to re-estimate the required HPT size, but if the<br>
added memory is small enough, that size can still be smaller than<br>
qemu's initial guess.<br></blockquote><div><br></div><div>Thanks for the clarification.<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> HPT resizing<br>
> requests fail though, but next reboot crashes the guest.<br>
<br>
</span>As noted the shrink is expected, so we need to debug the crash<br>
separately.  Do you have 9478956794c11239b7c1c3ef9ce95c<wbr>883bb839a3 in<br>
your tree?<br></blockquote><div><br></div><div>I do now and I no longer see the crash that I was observing last week.<br><br></div><div>Regards,<br></div><div>Bharata.</div></div></div></div>