[{"id":1734803,"web_url":"http://patchwork.ozlabs.org/comment/1734803/","msgid":"<87y3r3sj57.fsf@concordia.ellerman.id.au>","date":"2017-08-01T09:59:48","subject":"Re: [RFC PATCH] powerpc: Disabling MEMORY_HOTPLUG_DEFAULT_ONLINE\n\toption for PPC64 arch","submitter":{"id":46580,"url":"http://patchwork.ozlabs.org/api/people/46580/","name":"Michael Ellerman","email":"mpe@ellerman.id.au"},"content":"Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> writes:\n\n> Commit 943db62c316c (\"powerpc/pseries: Revert 'Auto-online\n> hotplugged memory'\") reverted the auto-online feature for pseries due\n> to problems with LMB removals not updating the device struct properly.\n> Among other things, this commit made the following change in\n> arch/powerpc/configs/pseries_defconfig:\n>\n> @@ -58,7 +58,6 @@ CONFIG_KEXEC_FILE=y\n>  CONFIG_IRQ_ALL_CPUS=y\n>  CONFIG_MEMORY_HOTPLUG=y\n>  CONFIG_MEMORY_HOTREMOVE=y\n> -CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y\n>  CONFIG_KSM=y\n>\n> The intent was to disable the option in the defconfig of pseries, since\n> after that the code doesn't have this support anymore.\n\nIt's always polite to Cc the author of a commit you're referring to, so\nI added Nathan.\n\nThe intention when we merged that fix was that the auto-online code\nwould be \"fixed\" to mark the device online. I say \"fixed\" because it\nwasn't entirely clear if that was the correct behaviour, though it\ndefinitely seemed like it should be.\n\nI've lost track of where/if the discussion got to on whether the\nauto-online code should do that or not. Did anything get resolved?\n\n> However, this change\n> alone isn't enough to prevent situations such as [1], where\n> distros can enable the option unaware of the consequences of\n> doing it (e.g. breaking LMB hotplug altogether).\n>\n> Instead of relying on all distros knowing that pseries can't handle\n> CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y after 943db62c316c, this patch\n> changes mm/Kconfig to make the MEMORY_HOTPLUG_DEFAULT_ONLINE config\n> unavailable for the PPC64 arch.\n>\n> [1] https://bugzilla.redhat.com/show_bug.cgi?id=1476380\n>\n> Fixes: 943db62c316c (\"powerpc/pseries: Revert 'Auto-online hotplugged memory'\")\n> Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>\n> ---\n>  mm/Kconfig | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n\nI don't own that file, so we at least need an Ack from the mm folks.\n\ncheers\n\n> diff --git a/mm/Kconfig b/mm/Kconfig\n> index 48b1af4..a342c77 100644\n> --- a/mm/Kconfig\n> +++ b/mm/Kconfig\n> @@ -169,7 +169,7 @@ config MEMORY_HOTPLUG_SPARSE\n>  config MEMORY_HOTPLUG_DEFAULT_ONLINE\n>          bool \"Online the newly added memory blocks by default\"\n>          default n\n> -        depends on MEMORY_HOTPLUG\n> +        depends on MEMORY_HOTPLUG && !PPC64\n>          help\n>  \t  This option sets the default policy setting for memory hotplug\n>  \t  onlining policy (/sys/devices/system/memory/auto_online_blocks) which\n> -- \n> 2.9.4","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xMBfM4HWzz9tWN\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  1 Aug 2017 20:00:59 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xMBfM3VgbzDsPn\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  1 Aug 2017 20:00:59 +1000 (AEST)","from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xMBd3073KzDrk2\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue,  1 Aug 2017 19:59:51 +1000 (AEST)","from authenticated.ozlabs.org (localhost [127.0.0.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPSA id 3xMBd24wkWz9tWN;\n\tTue,  1 Aug 2017 19:59:50 +1000 (AEST)"],"From":"Michael Ellerman <mpe@ellerman.id.au>","To":"Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tnfont@linux.vnet.ibm.com <nfont@linux.vnet.ibm.com>","Subject":"Re: [RFC PATCH] powerpc: Disabling MEMORY_HOTPLUG_DEFAULT_ONLINE\n\toption for PPC64 arch","In-Reply-To":"<20170731181759.13839-1-danielhb@linux.vnet.ibm.com>","References":"<20170731181759.13839-1-danielhb@linux.vnet.ibm.com>","User-Agent":"Notmuch/0.21 (https://notmuchmail.org)","Date":"Tue, 01 Aug 2017 19:59:48 +1000","Message-ID":"<87y3r3sj57.fsf@concordia.ellerman.id.au>","MIME-Version":"1.0","Content-Type":"text/plain","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":1735078,"web_url":"http://patchwork.ozlabs.org/comment/1735078/","msgid":"<9f4cbb26-f8f4-7f42-0c73-deab23bd83d6@linux.vnet.ibm.com>","date":"2017-08-01T14:05:17","subject":"Re: [RFC PATCH] powerpc: Disabling MEMORY_HOTPLUG_DEFAULT_ONLINE\n\toption for PPC64 arch","submitter":{"id":17146,"url":"http://patchwork.ozlabs.org/api/people/17146/","name":"Nathan Fontenot","email":"nfont@linux.vnet.ibm.com"},"content":"On 08/01/2017 04:59 AM, Michael Ellerman wrote:\n> Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> writes:\n> \n>> Commit 943db62c316c (\"powerpc/pseries: Revert 'Auto-online\n>> hotplugged memory'\") reverted the auto-online feature for pseries due\n>> to problems with LMB removals not updating the device struct properly.\n>> Among other things, this commit made the following change in\n>> arch/powerpc/configs/pseries_defconfig:\n>>\n>> @@ -58,7 +58,6 @@ CONFIG_KEXEC_FILE=y\n>>  CONFIG_IRQ_ALL_CPUS=y\n>>  CONFIG_MEMORY_HOTPLUG=y\n>>  CONFIG_MEMORY_HOTREMOVE=y\n>> -CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y\n>>  CONFIG_KSM=y\n>>\n>> The intent was to disable the option in the defconfig of pseries, since\n>> after that the code doesn't have this support anymore.\n> \n> It's always polite to Cc the author of a commit you're referring to, so\n> I added Nathan.\n> \n> The intention when we merged that fix was that the auto-online code\n> would be \"fixed\" to mark the device online. I say \"fixed\" because it\n> wasn't entirely clear if that was the correct behaviour, though it\n> definitely seemed like it should be.\n> \n> I've lost track of where/if the discussion got to on whether the\n> auto-online code should do that or not. Did anything get resolved?\n\nI think, though I should go back and test to be sure, that everything\nworks in the latest mainline code. The issue causing this to be a problem\nwas in the original implementation of auto_online support. If you wanted\nto auto online memory, the code was calling memory_block_change_state().\nThis worked but did not update the device struct for each of the memory\nblock that was online'ed such that dev->offline == true even after the\nmemory was online.\n\nI sent a patch earlier this year (commit dc18d706a436) that corrected\nthis to call device_online() instead of memory_block_change_state().\nWith this fix (appears to have gone into the 4.11 kernel) it should be\npossible to use auto_online on power systems.\n\nAt this point I don't think we need this patch to disable auto online\nfor ppc64. I would be curious if this is still broken with the latest\nmainline code though.\n\n-Nathan\n  \n> \n>> However, this change\n>> alone isn't enough to prevent situations such as [1], where\n>> distros can enable the option unaware of the consequences of\n>> doing it (e.g. breaking LMB hotplug altogether).\n>>\n>> Instead of relying on all distros knowing that pseries can't handle\n>> CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y after 943db62c316c, this patch\n>> changes mm/Kconfig to make the MEMORY_HOTPLUG_DEFAULT_ONLINE config\n>> unavailable for the PPC64 arch.\n>>\n>> [1] https://bugzilla.redhat.com/show_bug.cgi?id=1476380\n>>\n>> Fixes: 943db62c316c (\"powerpc/pseries: Revert 'Auto-online hotplugged memory'\")\n>> Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>\n>> ---\n>>  mm/Kconfig | 2 +-\n>>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> I don't own that file, so we at least need an Ack from the mm folks.\n> \n> cheers\n> \n>> diff --git a/mm/Kconfig b/mm/Kconfig\n>> index 48b1af4..a342c77 100644\n>> --- a/mm/Kconfig\n>> +++ b/mm/Kconfig\n>> @@ -169,7 +169,7 @@ config MEMORY_HOTPLUG_SPARSE\n>>  config MEMORY_HOTPLUG_DEFAULT_ONLINE\n>>          bool \"Online the newly added memory blocks by default\"\n>>          default n\n>> -        depends on MEMORY_HOTPLUG\n>> +        depends on MEMORY_HOTPLUG && !PPC64\n>>          help\n>>  \t  This option sets the default policy setting for memory hotplug\n>>  \t  onlining policy (/sys/devices/system/memory/auto_online_blocks) which\n>> -- \n>> 2.9.4\n>","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xMJ664CB0z9tWR\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed,  2 Aug 2017 00:06:54 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xMJ662VV1zDrj3\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed,  2 Aug 2017 00:06:54 +1000 (AEST)","from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xMJ4M2jHnzDrJP\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tWed,  2 Aug 2017 00:05:23 +1000 (AEST)","from pps.filterd (m0098396.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv71E4S7k009971\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 1 Aug 2017 10:05:21 -0400","from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2c2nd2265r-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 01 Aug 2017 10:05:20 -0400","from localhost\n\tby e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from <nfont@linux.vnet.ibm.com>; \n\tTue, 1 Aug 2017 08:05:20 -0600","from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20)\n\tby e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tTue, 1 Aug 2017 08:05:18 -0600","from b03ledav005.gho.boulder.ibm.com\n\t(b03ledav005.gho.boulder.ibm.com [9.17.130.236])\n\tby b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v71E5HGW15138826; Tue, 1 Aug 2017 07:05:17 -0700","from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id B736DBE03B;\n\tTue,  1 Aug 2017 08:05:17 -0600 (MDT)","from [9.41.92.186] (unknown [9.41.92.186])\n\tby b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP id 7DC0ABE04C;\n\tTue,  1 Aug 2017 08:05:17 -0600 (MDT)"],"Subject":"Re: [RFC PATCH] powerpc: Disabling MEMORY_HOTPLUG_DEFAULT_ONLINE\n\toption for PPC64 arch","To":"Michael Ellerman <mpe@ellerman.id.au>,\n\tDaniel Henrique Barboza <danielhb@linux.vnet.ibm.com>,\n\tlinuxppc-dev@lists.ozlabs.org","References":"<20170731181759.13839-1-danielhb@linux.vnet.ibm.com>\n\t<87y3r3sj57.fsf@concordia.ellerman.id.au>","From":"Nathan Fontenot <nfont@linux.vnet.ibm.com>","Date":"Tue, 1 Aug 2017 09:05:17 -0500","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<87y3r3sj57.fsf@concordia.ellerman.id.au>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-TM-AS-GCONF":"00","x-cbid":"17080114-8235-0000-0000-00000C0839A7","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007465; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000215; SDB=6.00896025; UDB=6.00448199;\n\tIPR=6.00676212; \n\tBA=6.00005506; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016481;\n\tXFM=3.00000015; UTC=2017-08-01 14:05:19","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17080114-8236-0000-0000-00003D053CCD","Message-Id":"<9f4cbb26-f8f4-7f42-0c73-deab23bd83d6@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-01_07:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000\n\tdefinitions=main-1708010230","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":1735120,"web_url":"http://patchwork.ozlabs.org/comment/1735120/","msgid":"<a22a6445-528f-9070-f2f7-b981cee3878e@linux.vnet.ibm.com>","date":"2017-08-01T14:39:44","subject":"Re: [RFC PATCH] powerpc: Disabling MEMORY_HOTPLUG_DEFAULT_ONLINE\n\toption for PPC64 arch","submitter":{"id":64623,"url":"http://patchwork.ozlabs.org/api/people/64623/","name":"Daniel Henrique Barboza","email":"danielhb@linux.vnet.ibm.com"},"content":"On 08/01/2017 11:05 AM, Nathan Fontenot wrote:\n> On 08/01/2017 04:59 AM, Michael Ellerman wrote:\n>> Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> writes:\n>>\n>>> Commit 943db62c316c (\"powerpc/pseries: Revert 'Auto-online\n>>> hotplugged memory'\") reverted the auto-online feature for pseries due\n>>> to problems with LMB removals not updating the device struct properly.\n>>> Among other things, this commit made the following change in\n>>> arch/powerpc/configs/pseries_defconfig:\n>>>\n>>> @@ -58,7 +58,6 @@ CONFIG_KEXEC_FILE=y\n>>>   CONFIG_IRQ_ALL_CPUS=y\n>>>   CONFIG_MEMORY_HOTPLUG=y\n>>>   CONFIG_MEMORY_HOTREMOVE=y\n>>> -CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y\n>>>   CONFIG_KSM=y\n>>>\n>>> The intent was to disable the option in the defconfig of pseries, since\n>>> after that the code doesn't have this support anymore.\n>> It's always polite to Cc the author of a commit you're referring to, so\n>> I added Nathan.\nNoted. Thanks for adding Nathan in the CC.\n\n>>\n>> The intention when we merged that fix was that the auto-online code\n>> would be \"fixed\" to mark the device online. I say \"fixed\" because it\n>> wasn't entirely clear if that was the correct behaviour, though it\n>> definitely seemed like it should be.\n>>\n>> I've lost track of where/if the discussion got to on whether the\n>> auto-online code should do that or not. Did anything get resolved?\n> I think, though I should go back and test to be sure, that everything\n> works in the latest mainline code. The issue causing this to be a problem\n> was in the original implementation of auto_online support. If you wanted\n> to auto online memory, the code was calling memory_block_change_state().\n> This worked but did not update the device struct for each of the memory\n> block that was online'ed such that dev->offline == true even after the\n> memory was online.\n>\n> I sent a patch earlier this year (commit dc18d706a436) that corrected\n> this to call device_online() instead of memory_block_change_state().\n> With this fix (appears to have gone into the 4.11 kernel) it should be\n> possible to use auto_online on power systems.\n\nCommit dc18d706a436 was present in the 4.11 kernels that experiences this\nissue (Fedora 26 and Ubuntu 17.10 in my tests). So I am not entirely sure\nthat we can use auto_online on power systems, at least in those kernels.\n\n\n>\n> At this point I don't think we need this patch to disable auto online\n> for ppc64. I would be curious if this is still broken with the latest\n> mainline code though.\n\nIf the auto_online feature is already working in upstream 4.13 kernel \nthen I don't see\na reason to apply this patch either. We can leave it as a FYI/reminder \nof a problem\nthat was happening in 4.11 and got solved later on.\n\n\nThanks,\n\n\nDaniel\n\n>\n> -Nathan\n>    \n>>> However, this change\n>>> alone isn't enough to prevent situations such as [1], where\n>>> distros can enable the option unaware of the consequences of\n>>> doing it (e.g. breaking LMB hotplug altogether).\n>>>\n>>> Instead of relying on all distros knowing that pseries can't handle\n>>> CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y after 943db62c316c, this patch\n>>> changes mm/Kconfig to make the MEMORY_HOTPLUG_DEFAULT_ONLINE config\n>>> unavailable for the PPC64 arch.\n>>>\n>>> [1] https://bugzilla.redhat.com/show_bug.cgi?id=1476380\n>>>\n>>> Fixes: 943db62c316c (\"powerpc/pseries: Revert 'Auto-online hotplugged memory'\")\n>>> Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>\n>>> ---\n>>>   mm/Kconfig | 2 +-\n>>>   1 file changed, 1 insertion(+), 1 deletion(-)\n>> I don't own that file, so we at least need an Ack from the mm folks.\n>>\n>> cheers\n>>\n>>> diff --git a/mm/Kconfig b/mm/Kconfig\n>>> index 48b1af4..a342c77 100644\n>>> --- a/mm/Kconfig\n>>> +++ b/mm/Kconfig\n>>> @@ -169,7 +169,7 @@ config MEMORY_HOTPLUG_SPARSE\n>>>   config MEMORY_HOTPLUG_DEFAULT_ONLINE\n>>>           bool \"Online the newly added memory blocks by default\"\n>>>           default n\n>>> -        depends on MEMORY_HOTPLUG\n>>> +        depends on MEMORY_HOTPLUG && !PPC64\n>>>           help\n>>>   \t  This option sets the default policy setting for memory hotplug\n>>>   \t  onlining policy (/sys/devices/system/memory/auto_online_blocks) which\n>>> -- \n>>> 2.9.4","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xMJsk01lkz9s2G\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed,  2 Aug 2017 00:41:14 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xMJsj60TBzDrJf\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed,  2 Aug 2017 00:41:13 +1000 (AEST)","from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n\t[148.163.158.5])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xMJrP5YGyzDr2y\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tWed,  2 Aug 2017 00:40:05 +1000 (AEST)","from pps.filterd (m0098420.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv71EdvNH053293\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 1 Aug 2017 10:40:03 -0400","from e24smtp02.br.ibm.com (e24smtp02.br.ibm.com [32.104.18.86])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2c2tj2bfd2-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 01 Aug 2017 10:39:59 -0400","from localhost\n\tby e24smtp02.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from\n\t<danielhb@linux.vnet.ibm.com>; Tue, 1 Aug 2017 11:39:48 -0300","from d24relay03.br.ibm.com (9.13.39.225)\n\tby e24smtp02.br.ibm.com (10.172.0.142) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tTue, 1 Aug 2017 11:39:46 -0300","from d24av04.br.ibm.com (d24av04.br.ibm.com [9.8.31.97])\n\tby d24relay03.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tv71EdknB21561526\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 1 Aug 2017 11:39:46 -0300","from d24av04.br.ibm.com (localhost [127.0.0.1])\n\tby d24av04.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tv71Edkeg028086\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 1 Aug 2017 11:39:46 -0300","from [9.18.235.124] (arthas.br.ibm.com [9.18.235.124])\n\tby d24av04.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tv71EdjtK028082; Tue, 1 Aug 2017 11:39:46 -0300"],"Subject":"Re: [RFC PATCH] powerpc: Disabling MEMORY_HOTPLUG_DEFAULT_ONLINE\n\toption for PPC64 arch","To":"Nathan Fontenot <nfont@linux.vnet.ibm.com>,\n\tMichael Ellerman <mpe@ellerman.id.au>, linuxppc-dev@lists.ozlabs.org","References":"<20170731181759.13839-1-danielhb@linux.vnet.ibm.com>\n\t<87y3r3sj57.fsf@concordia.ellerman.id.au>\n\t<9f4cbb26-f8f4-7f42-0c73-deab23bd83d6@linux.vnet.ibm.com>","From":"Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>","Date":"Tue, 1 Aug 2017 11:39:44 -0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<9f4cbb26-f8f4-7f42-0c73-deab23bd83d6@linux.vnet.ibm.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","X-TM-AS-MML":"disable","x-cbid":"17080114-0020-0000-0000-000002C22063","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17080114-0021-0000-0000-000030E24BC4","Message-Id":"<a22a6445-528f-9070-f2f7-b981cee3878e@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-01_07:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000\n\tdefinitions=main-1708010241","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":1735891,"web_url":"http://patchwork.ozlabs.org/comment/1735891/","msgid":"<cfa76a51-9a6b-e5a6-9f6c-c526c566cb6b@linux.vnet.ibm.com>","date":"2017-08-02T10:55:30","subject":"Re: [RFC PATCH] powerpc: Disabling MEMORY_HOTPLUG_DEFAULT_ONLINE\n\toption for PPC64 arch","submitter":{"id":64623,"url":"http://patchwork.ozlabs.org/api/people/64623/","name":"Daniel Henrique Barboza","email":"danielhb@linux.vnet.ibm.com"},"content":"On 08/01/2017 11:39 AM, Daniel Henrique Barboza wrote:\n>\n>\n> On 08/01/2017 11:05 AM, Nathan Fontenot wrote:\n>\n>>\n>> At this point I don't think we need this patch to disable auto online\n>> for ppc64. I would be curious if this is still broken with the latest\n>> mainline code though.\n>\n> If the auto_online feature is already working in upstream 4.13 kernel \n> then I don't see\n> a reason to apply this patch either. We can leave it as a FYI/reminder \n> of a problem\n> that was happening in 4.11 and got solved later on.\n\nI've compiled an upstream kernel with CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y\nand the problem with LMB hotplug is still reproducible.\n\nThis means that it would be good to have any sort of mechanism (such as \nthe one this\npatch proposes) to remove this option from the pseries kernel until it \nis fixed.\n\nHere is the stack trace:\n\n\nLast login: Tue Aug  1 19:26:21 on hvc0\n[danielhb@localhost ~]$ uname -a\nLinux localhost.localdomain 4.13.0-rc3+ #1 SMP Tue Aug 1 21:29:14 CDT \n2017 ppc64le ppc64le ppc64le GNU/Linux\n[danielhb@localhost ~]$ QEMU 2.9.90 monitor - type 'help' for more \ninformation\n(qemu)\n(qemu) object_add memory-backend-ram,id=ram1,size=1G\n(qemu) device_add pc-dimm,id=dimm1,memdev=ram1\n(qemu) [  617.757086] kernel BUG at mm/memory_hotplug.c:1936!\n[  617.757245] Oops: Exception in kernel mode, sig: 5 [#1]\n[  617.757332] SMP NR_CPUS=1024\n[  617.757333] NUMA\n[  617.757396] pSeries\n[  617.757479] Modules linked in: ip6t_rpfilter ip6t_REJECT \nnf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute \nbridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 \nip6table_mangle ip6table_raw ip6table_security iptable_nat \nnf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack \niptable_mangle iptable_raw iptable_security ebtable_filter ebtables \nip6table_filter ip6_tables sunrpc ghash_generic vmx_crypto xfs libcrc32c \nbochs_drm drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops \nttm drm virtio_blk ibmvscsi virtio_pci ibmveth scsi_transport_srp \ni2c_core virtio_ring virtio crc32c_vpmsum\n[  617.758577] CPU: 6 PID: 5 Comm: kworker/u16:0 Not tainted 4.13.0-rc3+ #1\n[  617.758741] Workqueue: pseries hotplug workque pseries_hp_work_fn\n[  617.758852] task: c0000000feb9e780 task.stack: c0000000fe118000\n[  617.759047] NIP: c00000000037322c LR: c0000000003731b8 CTR: \n0000000000000000\n[  617.759171] REGS: c0000000fe11b790 TRAP: 0700   Not tainted (4.13.0-rc3+)\n[  617.759275] MSR: 800000000282b033 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE>\n[  617.759284]   CR: 22002424  XER: 20000000\n[  617.759450] CFAR: c0000000003731bc SOFTE: 1\n[  617.759450] GPR00: c0000000003731b8 c0000000fe11ba10 c00000000141f100 \n0000000000000001\n[  617.759450] GPR04: 0000000000000000 00000000000001a0 c0000000015dac30 \n0000000000008b80\n[  617.759450] GPR08: 0000000000000007 0000000000000002 c0000000e9873480 \n303078302d303030\n[  617.759450] GPR12: 0000000000002200 c00000000fd83c00 c000000000137f88 \nc0000000fe1f0e40\n[  617.759450] GPR16: 0000000000000000 0000000000000001 0000000000000004 \n0000000000000001\n[  617.759450] GPR20: c0000000fffffc28 0000000000000010 c0000000ebb1c184 \n0000000000000010\n[  617.759450] GPR24: c0000000fffffea0 c0000000f0aec4a0 c0000000fffffc28 \n0000000000000000\n[  617.759450] GPR28: 0000000000000000 c000000001347f08 0000000010000000 \n0000000100000000\n[  617.760679] NIP [c00000000037322c] remove_memory+0xfc/0x110\n[  617.760766] LR [c0000000003731b8] remove_memory+0x88/0x110\n[  617.760849] Call Trace:\n[  617.760895] [c0000000fe11ba10] [c0000000003731b8] \nremove_memory+0x88/0x110 (unreliable)\n[  617.761032] [c0000000fe11ba50] [c0000000000cb0e0] \ndlpar_add_lmb+0x280/0x480\n[  617.761214] [c0000000fe11bb30] [c0000000000cc83c] \ndlpar_memory+0xa5c/0xe50\n[  617.761319] [c0000000fe11bbf0] [c0000000000c3b88] \nhandle_dlpar_errorlog+0xf8/0x160\n[  617.761443] [c0000000fe11bc60] [c0000000000c3c84] \npseries_hp_work_fn+0x94/0xa0\n[  617.761568] [c0000000fe11bc90] [c00000000012e3e8] \nprocess_one_work+0x248/0x540\n[  617.761697] [c0000000fe11bd30] [c00000000012e768] \nworker_thread+0x88/0x5c0\n[  617.761857] [c0000000fe11bdc0] [c00000000013812c] kthread+0x1ac/0x1c0\n[  617.761962] [c0000000fe11be30] [c00000000000bc9c] \nret_from_kernel_thread+0x5c/0xc0\n[  617.762085] Instruction dump:\n[  617.762149] 4be09a9d 60000000 4bd95ac5 60000000 38210040 e8010010 \neb81ffe0 eba1ffe8\n[  617.762274] ebc1fff0 7c0803a6 ebe1fff8 4e800020 <0fe00000> 00000000 \n00000000 00000000\n[  617.762403] ---[ end trace feaa62099c5987b9 ]---\n\n\nThanks,\n\n\nDaniel\n\n>\n>\n> Thanks,\n>\n>\n> Daniel\n>\n>>\n>> -Nathan\n>>>> However, this change\n>>>> alone isn't enough to prevent situations such as [1], where\n>>>> distros can enable the option unaware of the consequences of\n>>>> doing it (e.g. breaking LMB hotplug altogether).\n>>>>\n>>>> Instead of relying on all distros knowing that pseries can't handle\n>>>> CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y after 943db62c316c, this patch\n>>>> changes mm/Kconfig to make the MEMORY_HOTPLUG_DEFAULT_ONLINE config\n>>>> unavailable for the PPC64 arch.\n>>>>\n>>>> [1] https://bugzilla.redhat.com/show_bug.cgi?id=1476380\n>>>>\n>>>> Fixes: 943db62c316c (\"powerpc/pseries: Revert 'Auto-online \n>>>> hotplugged memory'\")\n>>>> Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>\n>>>> ---\n>>>>   mm/Kconfig | 2 +-\n>>>>   1 file changed, 1 insertion(+), 1 deletion(-)\n>>> I don't own that file, so we at least need an Ack from the mm folks.\n>>>\n>>> cheers\n>>>\n>>>> diff --git a/mm/Kconfig b/mm/Kconfig\n>>>> index 48b1af4..a342c77 100644\n>>>> --- a/mm/Kconfig\n>>>> +++ b/mm/Kconfig\n>>>> @@ -169,7 +169,7 @@ config MEMORY_HOTPLUG_SPARSE\n>>>>   config MEMORY_HOTPLUG_DEFAULT_ONLINE\n>>>>           bool \"Online the newly added memory blocks by default\"\n>>>>           default n\n>>>> -        depends on MEMORY_HOTPLUG\n>>>> +        depends on MEMORY_HOTPLUG && !PPC64\n>>>>           help\n>>>>         This option sets the default policy setting for memory hotplug\n>>>>         onlining policy \n>>>> (/sys/devices/system/memory/auto_online_blocks) which\n>>>> -- \n>>>> 2.9.4\n>","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xMqrH6Ytyz9sRW\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed,  2 Aug 2017 20:56:47 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xMqrH5jpvzDsY8\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed,  2 Aug 2017 20:56:47 +1000 (AEST)","from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n\t[148.163.158.5])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xMqq3547GzDrnZ\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tWed,  2 Aug 2017 20:55:43 +1000 (AEST)","from pps.filterd (m0098417.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv72ArpFI077179\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 2 Aug 2017 06:55:41 -0400","from e24smtp03.br.ibm.com (e24smtp03.br.ibm.com [32.104.18.24])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2c39p0u0ug-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 02 Aug 2017 06:55:40 -0400","from localhost\n\tby e24smtp03.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from\n\t<danielhb@linux.vnet.ibm.com>; Wed, 2 Aug 2017 07:55:38 -0300","from d24relay03.br.ibm.com (9.13.39.225)\n\tby e24smtp03.br.ibm.com (10.172.0.139) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tWed, 2 Aug 2017 07:55:35 -0300","from d24av02.br.ibm.com (d24av02.br.ibm.com [9.8.31.93])\n\tby d24relay03.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tv72AtZS839387282\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 2 Aug 2017 07:55:35 -0300","from d24av02.br.ibm.com (localhost [127.0.0.1])\n\tby d24av02.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tv72AtbD4012528\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 2 Aug 2017 07:55:38 -0300","from [9.85.132.152] ([9.85.132.152])\n\tby d24av02.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tv72AtZq8012523; Wed, 2 Aug 2017 07:55:36 -0300"],"Subject":"Re: [RFC PATCH] powerpc: Disabling MEMORY_HOTPLUG_DEFAULT_ONLINE\n\toption for PPC64 arch","From":"Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>","To":"Nathan Fontenot <nfont@linux.vnet.ibm.com>,\n\tMichael Ellerman <mpe@ellerman.id.au>, linuxppc-dev@lists.ozlabs.org","References":"<20170731181759.13839-1-danielhb@linux.vnet.ibm.com>\n\t<87y3r3sj57.fsf@concordia.ellerman.id.au>\n\t<9f4cbb26-f8f4-7f42-0c73-deab23bd83d6@linux.vnet.ibm.com>\n\t<a22a6445-528f-9070-f2f7-b981cee3878e@linux.vnet.ibm.com>","Date":"Wed, 2 Aug 2017 07:55:30 -0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<a22a6445-528f-9070-f2f7-b981cee3878e@linux.vnet.ibm.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","X-TM-AS-MML":"disable","x-cbid":"17080210-0024-0000-0000-0000018D22ED","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17080210-0025-0000-0000-000016558890","Message-Id":"<cfa76a51-9a6b-e5a6-9f6c-c526c566cb6b@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-02_06:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000\n\tdefinitions=main-1708020178","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":1736107,"web_url":"http://patchwork.ozlabs.org/comment/1736107/","msgid":"<97de85dd-1fbd-3b91-7c7f-5a535f1fcb96@linux.vnet.ibm.com>","date":"2017-08-02T14:47:18","subject":"Re: [RFC PATCH] powerpc: Disabling MEMORY_HOTPLUG_DEFAULT_ONLINE\n\toption for PPC64 arch","submitter":{"id":17146,"url":"http://patchwork.ozlabs.org/api/people/17146/","name":"Nathan Fontenot","email":"nfont@linux.vnet.ibm.com"},"content":"On 08/02/2017 05:55 AM, Daniel Henrique Barboza wrote:\n> \n> On 08/01/2017 11:39 AM, Daniel Henrique Barboza wrote:\n>>\n>> On 08/01/2017 11:05 AM, Nathan Fontenot wrote:\n>>\n>>> At this point I don't think we need this patch to disable auto online\n>>> for ppc64. I would be curious if this is still broken with the latest\n>>> mainline code though.\n>>\n>> If the auto_online feature is already working in upstream 4.13 kernel then I don't see\n>> a reason to apply this patch either. We can leave it as a FYI/reminder of a problem\n>> that was happening in 4.11 and got solved later on.\n> \n> I've compiled an upstream kernel with CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y\n> and the problem with LMB hotplug is still reproducible.\n\nYes, I was able to re-create the same failure.\n> \n> This means that it would be good to have any sort of mechanism (such as the one this\n> patch proposes) to remove this option from the pseries kernel until it is fixed.\n\nAfter looking through the pseries dlpar code I found the issue. The dlpar code\nassumes the memory is offline after adding it. The call to device_online() then\nreturns non-zero (because the memory is already online) and the dlpar code\ninterprets that as a failure and tries to remove the memory. This then causes\nthe oops we see below because the memory is not offlined prior to the remove call.\n\nThere is a similar issue with memory remove when the memory is offlined (via sysfs)\nprior to trying to dlpar remove the memory. The attempt to dlpar remove fails,\nluckily with just an error message and not an oops.\n\nI'll send a patch out to fix this.\n\n-Nathan\n\n> \n> Here is the stack trace:\n> \n> \n> Last login: Tue Aug  1 19:26:21 on hvc0\n> [danielhb@localhost ~]$ uname -a\n> Linux localhost.localdomain 4.13.0-rc3+ #1 SMP Tue Aug 1 21:29:14 CDT 2017 ppc64le ppc64le ppc64le GNU/Linux\n> [danielhb@localhost ~]$ QEMU 2.9.90 monitor - type 'help' for more information\n> (qemu)\n> (qemu) object_add memory-backend-ram,id=ram1,size=1G\n> (qemu) device_add pc-dimm,id=dimm1,memdev=ram1\n> (qemu) [  617.757086] kernel BUG at mm/memory_hotplug.c:1936!\n> [  617.757245] Oops: Exception in kernel mode, sig: 5 [#1]\n> [  617.757332] SMP NR_CPUS=1024\n> [  617.757333] NUMA\n> [  617.757396] pSeries\n> [  617.757479] Modules linked in: ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_raw iptable_security ebtable_filter ebtables ip6table_filter ip6_tables sunrpc ghash_generic vmx_crypto xfs libcrc32c bochs_drm drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm drm virtio_blk ibmvscsi virtio_pci ibmveth scsi_transport_srp i2c_core virtio_ring virtio crc32c_vpmsum\n> [  617.758577] CPU: 6 PID: 5 Comm: kworker/u16:0 Not tainted 4.13.0-rc3+ #1\n> [  617.758741] Workqueue: pseries hotplug workque pseries_hp_work_fn\n> [  617.758852] task: c0000000feb9e780 task.stack: c0000000fe118000\n> [  617.759047] NIP: c00000000037322c LR: c0000000003731b8 CTR: 0000000000000000\n> [  617.759171] REGS: c0000000fe11b790 TRAP: 0700   Not tainted (4.13.0-rc3+)\n> [  617.759275] MSR: 800000000282b033 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE>\n> [  617.759284]   CR: 22002424  XER: 20000000\n> [  617.759450] CFAR: c0000000003731bc SOFTE: 1\n> [  617.759450] GPR00: c0000000003731b8 c0000000fe11ba10 c00000000141f100 0000000000000001\n> [  617.759450] GPR04: 0000000000000000 00000000000001a0 c0000000015dac30 0000000000008b80\n> [  617.759450] GPR08: 0000000000000007 0000000000000002 c0000000e9873480 303078302d303030\n> [  617.759450] GPR12: 0000000000002200 c00000000fd83c00 c000000000137f88 c0000000fe1f0e40\n> [  617.759450] GPR16: 0000000000000000 0000000000000001 0000000000000004 0000000000000001\n> [  617.759450] GPR20: c0000000fffffc28 0000000000000010 c0000000ebb1c184 0000000000000010\n> [  617.759450] GPR24: c0000000fffffea0 c0000000f0aec4a0 c0000000fffffc28 0000000000000000\n> [  617.759450] GPR28: 0000000000000000 c000000001347f08 0000000010000000 0000000100000000\n> [  617.760679] NIP [c00000000037322c] remove_memory+0xfc/0x110\n> [  617.760766] LR [c0000000003731b8] remove_memory+0x88/0x110\n> [  617.760849] Call Trace:\n> [  617.760895] [c0000000fe11ba10] [c0000000003731b8] remove_memory+0x88/0x110 (unreliable)\n> [  617.761032] [c0000000fe11ba50] [c0000000000cb0e0] dlpar_add_lmb+0x280/0x480\n> [  617.761214] [c0000000fe11bb30] [c0000000000cc83c] dlpar_memory+0xa5c/0xe50\n> [  617.761319] [c0000000fe11bbf0] [c0000000000c3b88] handle_dlpar_errorlog+0xf8/0x160\n> [  617.761443] [c0000000fe11bc60] [c0000000000c3c84] pseries_hp_work_fn+0x94/0xa0\n> [  617.761568] [c0000000fe11bc90] [c00000000012e3e8] process_one_work+0x248/0x540\n> [  617.761697] [c0000000fe11bd30] [c00000000012e768] worker_thread+0x88/0x5c0\n> [  617.761857] [c0000000fe11bdc0] [c00000000013812c] kthread+0x1ac/0x1c0\n> [  617.761962] [c0000000fe11be30] [c00000000000bc9c] ret_from_kernel_thread+0x5c/0xc0\n> [  617.762085] Instruction dump:\n> [  617.762149] 4be09a9d 60000000 4bd95ac5 60000000 38210040 e8010010 eb81ffe0 eba1ffe8\n> [  617.762274] ebc1fff0 7c0803a6 ebe1fff8 4e800020 <0fe00000> 00000000 00000000 00000000\n> [  617.762403] ---[ end trace feaa62099c5987b9 ]---\n> \n> \n> Thanks,\n> \n> \n> Daniel\n> \n>>\n>>\n>> Thanks,\n>>\n>>\n>> Daniel\n>>\n>>>\n>>> -Nathan\n>>>>> However, this change\n>>>>> alone isn't enough to prevent situations such as [1], where\n>>>>> distros can enable the option unaware of the consequences of\n>>>>> doing it (e.g. breaking LMB hotplug altogether).\n>>>>>\n>>>>> Instead of relying on all distros knowing that pseries can't handle\n>>>>> CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y after 943db62c316c, this patch\n>>>>> changes mm/Kconfig to make the MEMORY_HOTPLUG_DEFAULT_ONLINE config\n>>>>> unavailable for the PPC64 arch.\n>>>>>\n>>>>> [1] https://bugzilla.redhat.com/show_bug.cgi?id=1476380\n>>>>>\n>>>>> Fixes: 943db62c316c (\"powerpc/pseries: Revert 'Auto-online hotplugged memory'\")\n>>>>> Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>\n>>>>> ---\n>>>>>   mm/Kconfig | 2 +-\n>>>>>   1 file changed, 1 insertion(+), 1 deletion(-)\n>>>> I don't own that file, so we at least need an Ack from the mm folks.\n>>>>\n>>>> cheers\n>>>>\n>>>>> diff --git a/mm/Kconfig b/mm/Kconfig\n>>>>> index 48b1af4..a342c77 100644\n>>>>> --- a/mm/Kconfig\n>>>>> +++ b/mm/Kconfig\n>>>>> @@ -169,7 +169,7 @@ config MEMORY_HOTPLUG_SPARSE\n>>>>>   config MEMORY_HOTPLUG_DEFAULT_ONLINE\n>>>>>           bool \"Online the newly added memory blocks by default\"\n>>>>>           default n\n>>>>> -        depends on MEMORY_HOTPLUG\n>>>>> +        depends on MEMORY_HOTPLUG && !PPC64\n>>>>>           help\n>>>>>         This option sets the default policy setting for memory hotplug\n>>>>>         onlining policy (/sys/devices/system/memory/auto_online_blocks) which\n>>>>> -- \n>>>>> 2.9.4\n>>\n>","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xMwzv0017z9sRW\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  3 Aug 2017 00:48:42 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xMwzt5hpTzDsXj\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  3 Aug 2017 00:48:42 +1000 (AEST)","from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xMwyN4xSGzDr5F\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu,  3 Aug 2017 00:47:24 +1000 (AEST)","from pps.filterd (m0098399.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv72EirGq073055\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 2 Aug 2017 10:47:22 -0400","from e37.co.us.ibm.com (e37.co.us.ibm.com [32.97.110.158])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2c3e4vh78s-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 02 Aug 2017 10:47:22 -0400","from localhost\n\tby e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from <nfont@linux.vnet.ibm.com>; \n\tWed, 2 Aug 2017 08:47:21 -0600","from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16)\n\tby e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tWed, 2 Aug 2017 08:47:19 -0600","from b03ledav002.gho.boulder.ibm.com\n\t(b03ledav002.gho.boulder.ibm.com [9.17.130.233])\n\tby b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v72ElIje29622400; Wed, 2 Aug 2017 07:47:18 -0700","from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id B2587136040;\n\tWed,  2 Aug 2017 08:47:18 -0600 (MDT)","from [9.41.92.186] (unknown [9.41.92.186])\n\tby b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP id\n\t709E2136044; Wed,  2 Aug 2017 08:47:18 -0600 (MDT)"],"Subject":"Re: [RFC PATCH] powerpc: Disabling MEMORY_HOTPLUG_DEFAULT_ONLINE\n\toption for PPC64 arch","To":"Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>,\n\tMichael Ellerman <mpe@ellerman.id.au>, linuxppc-dev@lists.ozlabs.org","References":"<20170731181759.13839-1-danielhb@linux.vnet.ibm.com>\n\t<87y3r3sj57.fsf@concordia.ellerman.id.au>\n\t<9f4cbb26-f8f4-7f42-0c73-deab23bd83d6@linux.vnet.ibm.com>\n\t<a22a6445-528f-9070-f2f7-b981cee3878e@linux.vnet.ibm.com>\n\t<cfa76a51-9a6b-e5a6-9f6c-c526c566cb6b@linux.vnet.ibm.com>","From":"Nathan Fontenot <nfont@linux.vnet.ibm.com>","Date":"Wed, 2 Aug 2017 09:47:18 -0500","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<cfa76a51-9a6b-e5a6-9f6c-c526c566cb6b@linux.vnet.ibm.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-TM-AS-GCONF":"00","x-cbid":"17080214-0024-0000-0000-000016F6B86C","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007471; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000216; SDB=6.00896519; UDB=6.00448495;\n\tIPR=6.00676706; \n\tBA=6.00005506; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016498;\n\tXFM=3.00000015; UTC=2017-08-02 14:47:20","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17080214-0025-0000-0000-00004C1DE8B5","Message-Id":"<97de85dd-1fbd-3b91-7c7f-5a535f1fcb96@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-02_07:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000\n\tdefinitions=main-1708020238","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}}]