<div dir="ltr"><div><div><div><div><div><div>Hi,<br><br></div>Memory hotplug for a pseries guest on PowerKVM fails with the following error when CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y in the guest kernel. (I am on commit b23afd384801)<br><br>[root@localhost ~]#  pseries-hotplug-mem: Attempting to hot-add 4 LMB(s) at index 80000020<br>removing memory fails, because memory [0x0000000200000000-0x000000020fffffff] is onlined<br>------------[ cut here ]------------<br>kernel BUG at mm/memory_hotplug.c:2189!<br>Oops: Exception in kernel mode, sig: 5 [#1]<br>Call Trace:<br>remove_memory+0x70/0x100 (unreliable)<br>dlpar_add_lmb+0x370/0x3f0<br>dlpar_memory+0x7bc/0xcd0<br>handle_dlpar_errorlog+0xf8/0x160<br>pseries_hp_work_fn+0x94/0xa0<br>process_one_work+0x240/0x510<br>worker_thread+0x9c/0x550<br>kthread+0x164/0x1b0<br>ret_from_kernel_thread+0x5c/0x7c<br><br></div><div>This failure occurs because the current code results in double onlining as memhp_auto_online gets set with CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y.<br></div><div><br></div>It appears that by reverting commit 943db62c316c5 (powerpc/pseries: Revert 'Auto-online hotplugged memory'), hotplug is working again.<br><br></div>Apparently that commit itself is a revert of other two commits which caused "the pseries memory DLPAR code to fail when trying to remove an LMB that was previously removed and added back". However I am able to do hotplug, unplug, plug and unplug of the same DIMM device (set of LMBs) most of the times with the above commit (943db62c316c5) reverted. The only occasional failure to unplug occurs when guest refuses to offline an LMB (with -EBUSY) possibly because it is in use, which I think is a valid failure.<br><br></div>Nathan - Could you please let me know the exact way to reproduce the problem that led to this commit (943db62c316c5) ?<br><br></div>Regards,<br></div>Bharata.<br><div><div><div><div><div><div><div><div>-- <br><div class="gmail_signature"><a href="http://raobharata.wordpress.com/" target="_blank">http://raobharata.wordpress.com/</a></div>
</div></div></div></div></div></div></div></div></div>