[{"id":1764504,"web_url":"http://patchwork.ozlabs.org/comment/1764504/","msgid":"<ab33351f-1d52-2e55-8aeb-32813ca52e94@linux.vnet.ibm.com>","date":"2017-09-07T05:09:27","subject":"Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on\n\tradix","submitter":{"id":664,"url":"http://patchwork.ozlabs.org/api/people/664/","name":"Aneesh Kumar K.V","email":"aneesh.kumar@linux.vnet.ibm.com"},"content":"On 09/07/2017 10:35 AM, Anton Blanchard wrote:\n> From: Anton Blanchard <anton@samba.org>\n> \n> Memory hot unplug on PowerNV radix hosts is broken. Our memory block\n> size is 256MB but since we map the linear region with very large pages,\n> each pte we tear down maps 1GB.\n> \n> A hot unplug of one 256MB memory block results in 768MB of memory\n> getting unintentionally unmapped. At this point we are likely to oops.\n> \n> Fix this by increasing our memory block size to 1GB on PowerNV radix\n> hosts.\n> \n> Signed-off-by: Anton Blanchard <anton@samba.org>\n> ---\n>   arch/powerpc/platforms/powernv/setup.c | 10 +++++++++-\n>   1 file changed, 9 insertions(+), 1 deletion(-)\n> \n> diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c\n> index 897aa1400eb8..bbb73aa0eb8f 100644\n> --- a/arch/powerpc/platforms/powernv/setup.c\n> +++ b/arch/powerpc/platforms/powernv/setup.c\n> @@ -272,7 +272,15 @@ static void pnv_kexec_cpu_down(int crash_shutdown, int secondary)\n>   #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE\n>   static unsigned long pnv_memory_block_size(void)\n>   {\n> -\treturn 256UL * 1024 * 1024;\n> +\t/*\n> +\t * We map the kernel linear region with 1GB large pages on radix. For\n> +\t * memory hot unplug to work our memory block size must be at least\n> +\t * this size.\n> +\t */\n> +\tif (radix_enabled())\n> +\t\treturn 1UL * 1024 * 1024 * 1024;\n> +\telse\n> +\t\treturn 256UL * 1024 * 1024;\n>   }\n>   #endif\n> \n\nThere is a similar issue being worked on w.r.t pseries.\n\nhttps://lkml.kernel.org/r/1502357028-27465-1-git-send-email-bharata@linux.vnet.ibm.com\n\nThe question is should we map these regions ? ie, we need to tell the \nkernel memory region that we would like to hot unplug later so that we \navoid doing kernel allocations from that. If we do that, then we can \npossibly map them via 2M size ?\n\n-aneesh","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 3xnpSb4XFBz9s8J\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  7 Sep 2017 15:10:55 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xnpSb3lkCzDrWS\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  7 Sep 2017 15:10:55 +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 3xnpR70GhszDrWL\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu,  7 Sep 2017 15:09:38 +1000 (AEST)","from pps.filterd (m0098409.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8759ZVr070242\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 7 Sep 2017 01:09:36 -0400","from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2cts2byfc7-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 07 Sep 2017 01:09:36 -0400","from localhost\n\tby e17.ny.us.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<aneesh.kumar@linux.vnet.ibm.com>; Thu, 7 Sep 2017 01:09:35 -0400","from b01cxnp22036.gho.pok.ibm.com (9.57.198.26)\n\tby e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 7 Sep 2017 01:09:31 -0400","from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com\n\t[9.57.199.107])\n\tby b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP\n\tid v8759VQO31260914; Thu, 7 Sep 2017 05:09:31 GMT","from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 86E45124035;\n\tThu,  7 Sep 2017 01:06:49 -0400 (EDT)","from [9.124.35.86] (unknown [9.124.35.86])\n\tby b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP id 1E47D12403F;\n\tThu,  7 Sep 2017 01:06:46 -0400 (EDT)"],"Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com\n\t(client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com;\n\tenvelope-from=aneesh.kumar@linux.vnet.ibm.com; receiver=<UNKNOWN>)","Subject":"Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on\n\tradix","To":"Anton Blanchard <anton@ozlabs.org>, benh@kernel.crashing.org,\n\tpaulus@samba.org, mpe@ellerman.id.au, bharata@linux.vnet.ibm.com,\n\tarbab@linux.vnet.ibm.com, npiggin@gmail.com, mikey@neuling.org,\n\tcyrilbur@gmail.com","References":"<20170907050551.4632-1-anton@ozlabs.org>","From":"\"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com>","Date":"Thu, 7 Sep 2017 10:39:27 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170907050551.4632-1-anton@ozlabs.org>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-TM-AS-GCONF":"00","x-cbid":"17090705-0040-0000-0000-0000039D89A9","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007681; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000226; SDB=6.00913400; UDB=6.00458429;\n\tIPR=6.00693659; \n\tBA=6.00005574; 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.00017044;\n\tXFM=3.00000015; UTC=2017-09-07 05:09:33","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17090705-0041-0000-0000-0000079289BB","Message-Id":"<ab33351f-1d52-2e55-8aeb-32813ca52e94@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-07_04:, , 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-1707230000\n\tdefinitions=main-1709070075","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>","Cc":"linuxppc-dev@lists.ozlabs.org","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":1764508,"web_url":"http://patchwork.ozlabs.org/comment/1764508/","msgid":"<20170907151741.41ee33a8@kryten>","date":"2017-09-07T05:17:41","subject":"Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on\n\tradix","submitter":{"id":69104,"url":"http://patchwork.ozlabs.org/api/people/69104/","name":"Anton Blanchard","email":"anton@ozlabs.org"},"content":"Hi,\n\n> There is a similar issue being worked on w.r.t pseries.\n> \n> https://lkml.kernel.org/r/1502357028-27465-1-git-send-email-bharata@linux.vnet.ibm.com\n> \n> The question is should we map these regions ? ie, we need to tell the \n> kernel memory region that we would like to hot unplug later so that\n> we avoid doing kernel allocations from that. If we do that, then we\n> can possibly map them via 2M size ?\n\nBut all of memory on PowerNV should be able to be hot unplugged, so\nthere are two options as I see it - either increase the memory block\nsize, or map everything with 2MB pages. \n\nAnton","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 3xnpf72Hyhz9sNV\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  7 Sep 2017 15:19:11 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xnpf65FbTzDrWP\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  7 Sep 2017 15:19:10 +1000 (AEST)","from ozlabs.org (bilbo.ozlabs.org [103.22.144.67])\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 3xnpcW6sMMzDqG3\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu,  7 Sep 2017 15:17:47 +1000 (AEST)","from authenticated.ozlabs.org (localhost [127.0.0.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPSA id 3xnpcS6zCnz9s8J;\n\tThu,  7 Sep 2017 15:17:44 +1000 (AEST)"],"Authentication-Results":["ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tsecure) header.d=ozlabs.org header.i=@ozlabs.org header.b=\"IzZFIjj7\";\n\tdkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tsecure) header.d=ozlabs.org header.i=@ozlabs.org header.b=\"IzZFIjj7\";\n\tdkim-atps=neutral","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tsecure) header.d=ozlabs.org header.i=@ozlabs.org header.b=\"IzZFIjj7\"; \n\tdkim-atps=neutral"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; \n\tt=1504761467; bh=8LC+ZVZvzSfJvIqPouZdX+tgow6UtNYLsjvGdpeKPIQ=;\n\th=Date:From:To:Cc:Subject:In-Reply-To:References:From;\n\tb=IzZFIjj7XjnPyjfHPpW8J4iyrh53s2dbrRoUFqdm0vk+73Kp5lO3MQaNsTex8zDZJ\n\tqVhQS+wTMiqQ0ngyG2u3TxALpAArDAhGh7/Zl4D83qxwLiJ/khuPxWximsgzsKltRU\n\tzw09XNt+7oQOT15CVUSALBURqi/WG+0Q1Wm8Y3nOLxUEKf4rXkvF/BB/+/DN0GJTxT\n\t0wY8xQGItJZQE4P2An+igUMcQgfjPBX6z9z3L9Fojc6ax4mu6WdaqYe7a38weWZLhI\n\t+xMYx3WUMOmyzetjeTo1iLFNlSVu11JjfG5LzLUebqKSLzBp6pJqBZ1KiDCfTGgHKG\n\tLQF83SPbb/V+A==","Date":"Thu, 7 Sep 2017 15:17:41 +1000","From":"Anton Blanchard <anton@ozlabs.org>","To":"\"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com>","Subject":"Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on\n\tradix","Message-ID":"<20170907151741.41ee33a8@kryten>","In-Reply-To":"<ab33351f-1d52-2e55-8aeb-32813ca52e94@linux.vnet.ibm.com>","References":"<20170907050551.4632-1-anton@ozlabs.org>\n\t<ab33351f-1d52-2e55-8aeb-32813ca52e94@linux.vnet.ibm.com>","X-Mailer":"Mutt/1.8.0 (2017-02-23)","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","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>","Cc":"mikey@neuling.org, npiggin@gmail.com, paulus@samba.org,\n\tarbab@linux.vnet.ibm.com, bharata@linux.vnet.ibm.com,\n\tlinuxppc-dev@lists.ozlabs.org, cyrilbur@gmail.com","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":1764553,"web_url":"http://patchwork.ozlabs.org/comment/1764553/","msgid":"<1504768881.12628.23.camel@kernel.crashing.org>","date":"2017-09-07T07:21:21","subject":"Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on\n\tradix","submitter":{"id":38,"url":"http://patchwork.ozlabs.org/api/people/38/","name":"Benjamin Herrenschmidt","email":"benh@kernel.crashing.org"},"content":"On Thu, 2017-09-07 at 15:17 +1000, Anton Blanchard wrote:\n> Hi,\n> \n> > There is a similar issue being worked on w.r.t pseries.\n> > \n> > https://lkml.kernel.org/r/1502357028-27465-1-git-send-email-bharata@linux.vnet.ibm.com\n> > \n> > The question is should we map these regions ? ie, we need to tell the \n> > kernel memory region that we would like to hot unplug later so that\n> > we avoid doing kernel allocations from that. If we do that, then we\n> > can possibly map them via 2M size ?\n> \n> But all of memory on PowerNV should be able to be hot unplugged, so\n> there are two options as I see it - either increase the memory block\n> size, or map everything with 2MB pages. \n\nOr be smarter and map with 1G when blocks of 1G are available and break\ndown to 2M where necessary, it shouldn't be too hard.\n\nCheers,\nBen.","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 3xnsNx2dkxz9sCZ\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  7 Sep 2017 17:22:57 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xnsNx1XNwzDrVZ\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  7 Sep 2017 17:22:57 +1000 (AEST)","from gate.crashing.org (gate.crashing.org [63.228.1.57])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xnsMS4MTVzDqZ5\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu,  7 Sep 2017 17:21:40 +1000 (AEST)","from localhost (localhost.localdomain [127.0.0.1])\n\tby gate.crashing.org (8.14.1/8.13.8) with ESMTP id v877LL0h009167;\n\tThu, 7 Sep 2017 02:21:23 -0500"],"Authentication-Results":"ozlabs.org; spf=permerror (mailfrom)\n\tsmtp.mailfrom=kernel.crashing.org (client-ip=63.228.1.57;\n\thelo=gate.crashing.org; envelope-from=benh@kernel.crashing.org;\n\treceiver=<UNKNOWN>)","Message-ID":"<1504768881.12628.23.camel@kernel.crashing.org>","Subject":"Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on\n\tradix","From":"Benjamin Herrenschmidt <benh@kernel.crashing.org>","To":"Anton Blanchard <anton@ozlabs.org>, \"Aneesh Kumar K.V\"\n\t<aneesh.kumar@linux.vnet.ibm.com>","Date":"Thu, 07 Sep 2017 17:21:21 +1000","In-Reply-To":"<20170907151741.41ee33a8@kryten>","References":"<20170907050551.4632-1-anton@ozlabs.org>\n\t<ab33351f-1d52-2e55-8aeb-32813ca52e94@linux.vnet.ibm.com>\n\t<20170907151741.41ee33a8@kryten>","Content-Type":"text/plain; charset=\"UTF-8\"","X-Mailer":"Evolution 3.24.5 (3.24.5-1.fc26) ","Mime-Version":"1.0","Content-Transfer-Encoding":"7bit","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>","Cc":"mikey@neuling.org, npiggin@gmail.com, paulus@samba.org,\n\tarbab@linux.vnet.ibm.com, bharata@linux.vnet.ibm.com,\n\tlinuxppc-dev@lists.ozlabs.org, cyrilbur@gmail.com","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":1764799,"web_url":"http://patchwork.ozlabs.org/comment/1764799/","msgid":"<20170907155902.kpzhgqqsxbwxwce5@arbab-laptop.localdomain>","date":"2017-09-07T15:59:02","subject":"Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on\n\tradix","submitter":{"id":69358,"url":"http://patchwork.ozlabs.org/api/people/69358/","name":"Reza Arbab","email":"arbab@linux.vnet.ibm.com"},"content":"On Thu, Sep 07, 2017 at 05:17:41AM +0000, Anton Blanchard wrote:\n>But all of memory on PowerNV should be able to be hot unplugged, so\n>there are two options as I see it - either increase the memory block\n>size, or map everything with 2MB pages.\n\nI may be misunderstanding this, but what if we did something like x86 \ndoes? When trying to unplug a region smaller than the mapping, they fill \nthat part of the pagetable with 0xFD instead of freeing the whole thing.  \nOnce the whole thing is 0xFD, free it.\n\nSee arch/x86/mm/init_64.c:remove_{pte,pmd,pud}_table()\n\n---%<---\n\tmemset((void *)addr, PAGE_INUSE, next - addr);\n\n\tpage_addr = page_address(pte_page(*pte));\n\tif (!memchr_inv(page_addr, PAGE_INUSE, PAGE_SIZE)) {\n\t\t...\n\t\tpte_clear(&init_mm, addr, pte);\n\t\t...\n\t}\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 3xp4ss2dn2z9s7C\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  8 Sep 2017 02:00:17 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xp4ss1YcxzDrZ3\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  8 Sep 2017 02:00:17 +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 3xp4rd0rQFzDrTW\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri,  8 Sep 2017 01:59:12 +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\tv87Fx7Ha130029\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 7 Sep 2017 11:59:10 -0400","from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2cu77cevf3-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 07 Sep 2017 11:59:10 -0400","from localhost\n\tby e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from <arbab@linux.vnet.ibm.com>; \n\tThu, 7 Sep 2017 11:59:08 -0400","from b01cxnp22036.gho.pok.ibm.com (9.57.198.26)\n\tby e13.ny.us.ibm.com (146.89.104.200) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 7 Sep 2017 11:59:05 -0400","from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com\n\t[9.57.199.107])\n\tby b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP\n\tid v87Fx47F49938618; Thu, 7 Sep 2017 15:59:04 GMT","from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 0D8E6124037;\n\tThu,  7 Sep 2017 11:56:23 -0400 (EDT)","from arbab-laptop.localdomain (unknown [9.53.92.213])\n\tby b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP id E671A124035;\n\tThu,  7 Sep 2017 11:56:22 -0400 (EDT)","from arbab-laptop.localdomain (localhost.localdomain [IPv6:::1])\n\tby arbab-laptop.localdomain (Postfix) with ESMTP id CB98346072B;\n\tThu,  7 Sep 2017 10:59:02 -0500 (CDT)"],"Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com\n\t(client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com;\n\tenvelope-from=arbab@linux.vnet.ibm.com; receiver=<UNKNOWN>)","Date":"Thu, 7 Sep 2017 10:59:02 -0500","From":"Reza Arbab <arbab@linux.vnet.ibm.com>","To":"Anton Blanchard <anton@ozlabs.org>","Subject":"Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on\n\tradix","References":"<20170907050551.4632-1-anton@ozlabs.org>\n\t<ab33351f-1d52-2e55-8aeb-32813ca52e94@linux.vnet.ibm.com>\n\t<20170907151741.41ee33a8@kryten>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii; format=flowed","Content-Disposition":"inline","In-Reply-To":"<20170907151741.41ee33a8@kryten>","Organization":"IBM Linux Technology Center","User-Agent":"NeoMutt/20170907 (1.9.0)","X-TM-AS-GCONF":"00","x-cbid":"17090715-0008-0000-0000-0000027BDF36","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007683; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000226; SDB=6.00913617; UDB=6.00458559;\n\tIPR=6.00693875; \n\tBA=6.00005576; 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.00017053;\n\tXFM=3.00000015; UTC=2017-09-07 15:59:07","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17090715-0009-0000-0000-0000369F1A2A","Message-Id":"<20170907155902.kpzhgqqsxbwxwce5@arbab-laptop.localdomain>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-07_09:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=2\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1709070236","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>","Cc":"mikey@neuling.org, npiggin@gmail.com, paulus@samba.org,\n\t\"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com>,\n\tbharata@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org,\n\tcyrilbur@gmail.com","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":1765028,"web_url":"http://patchwork.ozlabs.org/comment/1765028/","msgid":"<20170908111547.0f30e1a5@kryten>","date":"2017-09-08T01:15:47","subject":"Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on\n\tradix","submitter":{"id":69104,"url":"http://patchwork.ozlabs.org/api/people/69104/","name":"Anton Blanchard","email":"anton@ozlabs.org"},"content":"Hi Reza,\n\n> I may be misunderstanding this, but what if we did something like x86 \n> does? When trying to unplug a region smaller than the mapping, they\n> fill that part of the pagetable with 0xFD instead of freeing the\n> whole thing. Once the whole thing is 0xFD, free it.\n> \n> See arch/x86/mm/init_64.c:remove_{pte,pmd,pud}_table()\n> \n> ---%<---\n> \tmemset((void *)addr, PAGE_INUSE, next - addr);\n> \n> \tpage_addr = page_address(pte_page(*pte));\n> \tif (!memchr_inv(page_addr, PAGE_INUSE, PAGE_SIZE)) {\n> \t\t...\n> \t\tpte_clear(&init_mm, addr, pte);\n> \t\t...\n> \t}\n> ---%<---\n\nBut you only have 1GB ptes at this point, you'd need to start\ninstantiating a new level in the tree, and populate 2MB ptes.\n\nThat is what Ben is suggesting. I'm happy to go any way (fix hotplug\nto handle this, or increase the memblock size on PowerNV to 1GB), I just\nneed a solution.\n\nAnton","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 3xpKFc5h4Jz9sQl\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  8 Sep 2017 11:18:12 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xpKFc4WJqzDrYq\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  8 Sep 2017 11:18:12 +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 3xpKBy5cQLzDrb0\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri,  8 Sep 2017 11:15:54 +1000 (AEST)","from authenticated.ozlabs.org (localhost [127.0.0.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPSA id 3xpKBv01Hqz9sBZ;\n\tFri,  8 Sep 2017 11:15:50 +1000 (AEST)"],"Authentication-Results":["ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tsecure) header.d=ozlabs.org header.i=@ozlabs.org header.b=\"Kp+JAw7J\";\n\tdkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tsecure) header.d=ozlabs.org header.i=@ozlabs.org header.b=\"Kp+JAw7J\";\n\tdkim-atps=neutral","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tsecure) header.d=ozlabs.org header.i=@ozlabs.org header.b=\"Kp+JAw7J\"; \n\tdkim-atps=neutral"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; \n\tt=1504833354; bh=rvkwkNgXdwJyPNszhmHR5eNQll3nhtMF6EDIKx82MuU=;\n\th=Date:From:To:Cc:Subject:In-Reply-To:References:From;\n\tb=Kp+JAw7J0vIjto8iq4an6UbBItFLCaeJgYVIESlw/fT1Nh18kBGXofjXZAsHEWHaU\n\tuizGlwCVvGSujtwo82V90ZWKXtVnHra+pjyJ6SbeeMtdTzg105Cg5KUv3zgPfrGDF4\n\t5nRFHMcUdSdsk9TeOpT1NgclSGDJroCD0qXXBtXfFhkXZNFywCbLBFTtYwvxwZnCBe\n\t4QZdbI0QUNK66RoNanjqFYdCw96baaMlAp2UonsvCiQCnLfmry8rBTbUlH0gFeiwsm\n\txlgr6XiQeulYhgIDwfFtpMRFFH6GaJe4lK8gpFKcCSFd4gqaSy+sg7q7s7IMiYgZpX\n\tmcxb/eYfvisnw==","Date":"Fri, 8 Sep 2017 11:15:47 +1000","From":"Anton Blanchard <anton@ozlabs.org>","To":"Reza Arbab <arbab@linux.vnet.ibm.com>","Subject":"Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on\n\tradix","Message-ID":"<20170908111547.0f30e1a5@kryten>","In-Reply-To":"<20170907155902.kpzhgqqsxbwxwce5@arbab-laptop.localdomain>","References":"<20170907050551.4632-1-anton@ozlabs.org>\n\t<ab33351f-1d52-2e55-8aeb-32813ca52e94@linux.vnet.ibm.com>\n\t<20170907151741.41ee33a8@kryten>\n\t<20170907155902.kpzhgqqsxbwxwce5@arbab-laptop.localdomain>","X-Mailer":"Mutt/1.8.0 (2017-02-23)","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","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>","Cc":"mikey@neuling.org, npiggin@gmail.com, paulus@samba.org,\n\t\"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com>,\n\tbharata@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org,\n\tcyrilbur@gmail.com","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":1765628,"web_url":"http://patchwork.ozlabs.org/comment/1765628/","msgid":"<CAKTCnzk_O9Oacr+y08=PBLZpXX3-tZbdGoT6b-iwxb1zZphAVA@mail.gmail.com>","date":"2017-09-08T21:51:05","subject":"Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on\n\tradix","submitter":{"id":9347,"url":"http://patchwork.ozlabs.org/api/people/9347/","name":"Balbir Singh","email":"bsingharora@gmail.com"},"content":"On Thu, Sep 7, 2017 at 5:21 PM, Benjamin Herrenschmidt\n<benh@kernel.crashing.org> wrote:\n> On Thu, 2017-09-07 at 15:17 +1000, Anton Blanchard wrote:\n>> Hi,\n>>\n>> > There is a similar issue being worked on w.r.t pseries.\n>> >\n>> > https://lkml.kernel.org/r/1502357028-27465-1-git-send-email-bharata@linux.vnet.ibm.com\n>> >\n>> > The question is should we map these regions ? ie, we need to tell the\n>> > kernel memory region that we would like to hot unplug later so that\n>> > we avoid doing kernel allocations from that. If we do that, then we\n>> > can possibly map them via 2M size ?\n>>\n>> But all of memory on PowerNV should be able to be hot unplugged, so\n\nFor this ideally we need movable mappings for the regions we intend\nto hot-unplug - no? Otherwise, there is no guarantee that hot-unplug\nwill work\n\n>> there are two options as I see it - either increase the memory block\n>> size, or map everything with 2MB pages.\n>\n> Or be smarter and map with 1G when blocks of 1G are available and break\n> down to 2M where necessary, it shouldn't be too hard.\n>\n\nstrict_rwx patches added helpers to do this\n\nBalbir Singh.","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 3xprdv14K4z9s82\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat,  9 Sep 2017 07:52:35 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xprdv00VqzDrct\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat,  9 Sep 2017 07:52:35 +1000 (AEST)","from mail-ua0-x242.google.com (mail-ua0-x242.google.com\n\t[IPv6:2607:f8b0:400c:c08::242])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xprcD6NjgzDrbq\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tSat,  9 Sep 2017 07:51:08 +1000 (AEST)","by mail-ua0-x242.google.com with SMTP id s15so1075857uag.0\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 08 Sep 2017 14:51:08 -0700 (PDT)","by 10.176.75.25 with HTTP; Fri, 8 Sep 2017 14:51:05 -0700 (PDT)"],"Authentication-Results":["ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"GLJ3UVOL\"; dkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"GLJ3UVOL\"; dkim-atps=neutral","ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:400c:c08::242; helo=mail-ua0-x242.google.com;\n\tenvelope-from=bsingharora@gmail.com; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"GLJ3UVOL\"; dkim-atps=neutral"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=ddFvlLg29+sLeiqCpKlL02EqMwoVCx+Z8kDEJXLFXBQ=;\n\tb=GLJ3UVOLMFqgkqjyPYnzChc551qW9PxJNseopq0ScClm8WwGQr3PNi42yHE2Vz3ayj\n\tlF9d/2yvGyINiX2V76ctJOGum7QO8XSYBKTgPaoUnyZYSQyJBDZVAgvvlZMD6/tgq4lP\n\ti5+s/ucnCcfxt19UCN6JhC5GmQj3OK3ukpFrTJAQS8K9HdWm7eO94r2OnzyniojNMVQb\n\tzkHRLg8Kh9D4UMOwmgItBKe9mhgmgarNFLNtjXVj3293R0VnT+20EqNxZjZquzkxVT38\n\tL8+xw0GNAVN08TPt52uW+9wJKWDaB4R0N4f5tJt/BjYfIkVKFYE56bmOfP7VLcUUhHuq\n\tak+g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=ddFvlLg29+sLeiqCpKlL02EqMwoVCx+Z8kDEJXLFXBQ=;\n\tb=PKJChmk7qY0YQFTK1Cq7R4Y64CoMzwkA5WdyV8OAsYEWx32eDW2EMD9X2NHJ1RbkkX\n\t5nS484kcZ79Mdo2+TF4tOC7wH4SQ0lxLLWRLTeC2Dq5LILEHHsETUkr8oVrpjGtgz7LI\n\ta/MnzL9Evoxyw+vJTUBrsKyt8JmQFtSXwa+qCM+M05QksNV2ocf3NoS6o/0KKYfsJInc\n\tGZH4XBEjzViVWgb4Dax8ISwG/XMch5x7o+QHxxvDk/x1L6FVxeu8o1PFv2ipilCIQJzp\n\talsn2QoqOQMwXFdtIslZCYmyaHHc1YHv40233c9Vic86wZi9XqaoOgiIGVASuWYGDmYm\n\tb0DA==","X-Gm-Message-State":"AHPjjUg90TzFeLqtFmr4xPXriJkETxfeWx0vGRru0xZnjJjQ2EsDtUed\n\tKIENO9Ga4eeo9LR0VCaUQKP4flIdag==","X-Google-Smtp-Source":"ADKCNb4FodfsbVwOwvRzoX5kUBS3Iu+iKqGdc8LSO+LBfk5OHj4FCM/vG4NI8DAC4tu9g9zlSpDjgqxcZMerCKDRi5Y=","X-Received":"by 10.159.34.132 with SMTP id 4mr2624598uan.99.1504907466307;\n\tFri, 08 Sep 2017 14:51:06 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<1504768881.12628.23.camel@kernel.crashing.org>","References":"<20170907050551.4632-1-anton@ozlabs.org>\n\t<ab33351f-1d52-2e55-8aeb-32813ca52e94@linux.vnet.ibm.com>\n\t<20170907151741.41ee33a8@kryten>\n\t<1504768881.12628.23.camel@kernel.crashing.org>","From":"Balbir Singh <bsingharora@gmail.com>","Date":"Sat, 9 Sep 2017 07:51:05 +1000","Message-ID":"<CAKTCnzk_O9Oacr+y08=PBLZpXX3-tZbdGoT6b-iwxb1zZphAVA@mail.gmail.com>","Subject":"Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on\n\tradix","To":"Benjamin Herrenschmidt <benh@kernel.crashing.org>","Content-Type":"text/plain; charset=\"UTF-8\"","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>","Cc":"Michael Neuling <mikey@neuling.org>, Nicholas Piggin <npiggin@gmail.com>,\n\tReza Arbab <arbab@linux.vnet.ibm.com>,\n\tPaul Mackerras <paulus@samba.org>, \n\t\"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com>,\n\tBharata B Rao <bharata@linux.vnet.ibm.com>,\n\t\"open list:LINUX FOR POWERPC \\(32-BIT AND 64-BIT\\)\"\n\t<linuxppc-dev@lists.ozlabs.org>, Cyril Bur <cyrilbur@gmail.com>","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":1765901,"web_url":"http://patchwork.ozlabs.org/comment/1765901/","msgid":"<943A12E3-39BC-403D-81B3-CCB37993DE9A@ellerman.id.au>","date":"2017-09-09T21:30:14","subject":"Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on\n\tradix","submitter":{"id":4,"url":"http://patchwork.ozlabs.org/api/people/4/","name":"Michael Ellerman","email":"michael@ellerman.id.au"},"content":"We should do the 1G block size as a fix, and backport it, and then make the hot unplug code smarter.\n\ncheers\n\nOn 8 September 2017 11:15:47 am AEST, Anton Blanchard <anton@ozlabs.org> wrote:\n>Hi Reza,\n>\n>> I may be misunderstanding this, but what if we did something like x86\n>\n>> does? When trying to unplug a region smaller than the mapping, they\n>> fill that part of the pagetable with 0xFD instead of freeing the\n>> whole thing. Once the whole thing is 0xFD, free it.\n>> \n>> See arch/x86/mm/init_64.c:remove_{pte,pmd,pud}_table()\n>> \n>> ---%<---\n>> \tmemset((void *)addr, PAGE_INUSE, next - addr);\n>> \n>> \tpage_addr = page_address(pte_page(*pte));\n>> \tif (!memchr_inv(page_addr, PAGE_INUSE, PAGE_SIZE)) {\n>> \t\t...\n>> \t\tpte_clear(&init_mm, addr, pte);\n>> \t\t...\n>> \t}\n>> ---%<---\n>\n>But you only have 1GB ptes at this point, you'd need to start\n>instantiating a new level in the tree, and populate 2MB ptes.\n>\n>That is what Ben is suggesting. I'm happy to go any way (fix hotplug\n>to handle this, or increase the memblock size on PowerNV to 1GB), I\n>just\n>need a solution.\n>\n>Anton","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 3xqf1P5Td9z9sDB\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun, 10 Sep 2017 14:57:13 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xqf1P4hjszDrcn\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun, 10 Sep 2017 14:57:13 +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 3xqS5l3gwRzDrhq\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tSun, 10 Sep 2017 07:30:19 +1000 (AEST)","from authenticated.ozlabs.org (localhost [127.0.0.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPSA id 3xqS5j53B3z9s81;\n\tSun, 10 Sep 2017 07:30:17 +1000 (AEST)"],"Date":"Sun, 10 Sep 2017 07:30:14 +1000","User-Agent":"K-9 Mail for Android","In-Reply-To":"<20170908111547.0f30e1a5@kryten>","References":"<20170907050551.4632-1-anton@ozlabs.org>\n\t<ab33351f-1d52-2e55-8aeb-32813ca52e94@linux.vnet.ibm.com>\n\t<20170907151741.41ee33a8@kryten>\n\t<20170907155902.kpzhgqqsxbwxwce5@arbab-laptop.localdomain>\n\t<20170908111547.0f30e1a5@kryten>","MIME-Version":"1.0","Content-Type":"multipart/alternative;\n\tboundary=\"----MDY8HTV68M8EGKV60U40LYMJJYW6P7\"","Content-Transfer-Encoding":"7bit","Subject":"Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on\n\tradix","To":"linuxppc-dev@lists.ozlabs.org, Anton Blanchard <anton@ozlabs.org>,\n\tReza Arbab <arbab@linux.vnet.ibm.com>","From":"Michael Ellerman <michael@ellerman.id.au>","Message-ID":"<943A12E3-39BC-403D-81B3-CCB37993DE9A@ellerman.id.au>","X-Mailman-Approved-At":"Sun, 10 Sep 2017 14:56:04 +1000","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>","Cc":"mikey@neuling.org, npiggin@gmail.com, paulus@samba.org,\n\t\"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com>,\n\tbharata@linux.vnet.ibm.com, cyrilbur@gmail.com","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":1781446,"web_url":"http://patchwork.ozlabs.org/comment/1781446/","msgid":"<3y7n3c2442z9t4b@ozlabs.org>","date":"2017-10-06T11:10:04","subject":"Re: powerpc/powernv: Increase memory block size to 1GB on radix","submitter":{"id":69509,"url":"http://patchwork.ozlabs.org/api/people/69509/","name":"Michael Ellerman","email":"patch-notifications@ellerman.id.au"},"content":"On Thu, 2017-09-07 at 05:05:51 UTC, Anton Blanchard wrote:\n> From: Anton Blanchard <anton@samba.org>\n> \n> Memory hot unplug on PowerNV radix hosts is broken. Our memory block\n> size is 256MB but since we map the linear region with very large pages,\n> each pte we tear down maps 1GB.\n> \n> A hot unplug of one 256MB memory block results in 768MB of memory\n> getting unintentionally unmapped. At this point we are likely to oops.\n> \n> Fix this by increasing our memory block size to 1GB on PowerNV radix\n> hosts.\n> \n> Signed-off-by: Anton Blanchard <anton@samba.org>\n\nApplied to powerpc fixes, thanks.\n\nhttps://git.kernel.org/powerpc/c/53ecde0b9126ff140abe3aefd7f0ec\n\ncheers","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 3y7n5S2zd1z9t4b\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  6 Oct 2017 22:11:40 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3y7n5S0xY9zDqhg\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  6 Oct 2017 22:11:40 +1100 (AEDT)","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 3y7n3c33hWzDqhg\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri,  6 Oct 2017 22:10:04 +1100 (AEDT)","by ozlabs.org (Postfix, from userid 1034)\n\tid 3y7n3c2442z9t4b; Fri,  6 Oct 2017 22:10:04 +1100 (AEDT)"],"X-powerpc-patch-notification":"thanks","X-powerpc-patch-commit":"53ecde0b9126ff140abe3aefd7f0ec64d6fa36b0","In-Reply-To":"<20170907050551.4632-1-anton@ozlabs.org>","To":"Anton Blanchard <anton@ozlabs.org>, benh@kernel.crashing.org,\n\tpaulus@samba.org, bharata@linux.vnet.ibm.com, arbab@linux.vnet.ibm.com,\n\tnpiggin@gmail.com, mikey@neuling.org, cyrilbur@gmail.com,\n\taneesh.kumar@linux.vnet.ibm.com","From":"Michael Ellerman <patch-notifications@ellerman.id.au>","Subject":"Re: powerpc/powernv: Increase memory block size to 1GB on radix","Message-Id":"<3y7n3c2442z9t4b@ozlabs.org>","Date":"Fri,  6 Oct 2017 22:10:04 +1100 (AEDT)","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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>","Cc":"linuxppc-dev@lists.ozlabs.org","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>"}}]