From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161186AbcIZPsO (ORCPT ); Mon, 26 Sep 2016 11:48:14 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:46561 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938895AbcIZPsI (ORCPT ); Mon, 26 Sep 2016 11:48:08 -0400 X-IMSS-HAND-OFF-DIRECTIVE: 127.0.0.1:10026 From: "Aneesh Kumar K.V" To: Reza Arbab , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Rob Herring , Frank Rowand , Jonathan Corbet , Andrew Morton Cc: Bharata B Rao , Nathan Fontenot , Stewart Smith , Alistair Popple , Balbir Singh , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3 4/5] powerpc/mm: restore top-down allocation when using movable_node In-Reply-To: <1474828616-16608-5-git-send-email-arbab@linux.vnet.ibm.com> References: <1474828616-16608-1-git-send-email-arbab@linux.vnet.ibm.com> <1474828616-16608-5-git-send-email-arbab@linux.vnet.ibm.com> Date: Mon, 26 Sep 2016 21:17:43 +0530 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16092615-8235-0000-0000-000009471D88 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005814; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000185; SDB=6.00761510; UDB=6.00362719; IPR=6.00536466; BA=6.00004758; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012788; XFM=3.00000011; UTC=2016-09-26 15:48:04 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16092615-8236-0000-0000-00003527FC40 Message-Id: <8760piacio.fsf@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-26_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609020000 definitions=main-1609260299 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reza Arbab writes: > At boot, the movable_node option sets bottom-up memblock allocation. > > This reduces the chance that, in the window before movable memory has > been identified, an allocation for the kernel might come from a movable > node. By going bottom-up, early allocations will most likely come from > the same node as the kernel image, which is necessarily in a nonmovable > node. > > Then, once any known hotplug memory has been marked, allocation can be > reset back to top-down. On x86, this is done in numa_init(). This patch > does the same on power, in numa initmem_init(). > > Signed-off-by: Reza Arbab > --- > arch/powerpc/mm/numa.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c > index d7ac419..fdf1e69 100644 > --- a/arch/powerpc/mm/numa.c > +++ b/arch/powerpc/mm/numa.c > @@ -945,6 +945,9 @@ void __init initmem_init(void) > max_low_pfn = memblock_end_of_DRAM() >> PAGE_SHIFT; > max_pfn = max_low_pfn; > > + /* bottom-up allocation may have been set by movable_node */ > + memblock_set_bottom_up(false); > + By then we have done few memblock allocation right ? IMHO, we should do this early enough in prom.c after we do parse_early_param, with a comment there explaining that, we don't really support hotplug memblock and when we do that, this should be moved to a place where we can handle memblock allocation such that we avoid spreading memblock allocation to movable node. > if (parse_numa_properties()) > setup_nonnuma(); > else > -- > 1.8.3.1 -aneesh