From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3s5JH22W1GzDqPn for ; Fri, 5 Aug 2016 17:25:02 +1000 (AEST) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u757JZSt012031 for ; Fri, 5 Aug 2016 03:25:00 -0400 Received: from e28smtp02.in.ibm.com (e28smtp02.in.ibm.com [125.16.236.2]) by mx0a-001b2d01.pphosted.com with ESMTP id 24kkakhg64-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 05 Aug 2016 03:24:59 -0400 Received: from localhost by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 5 Aug 2016 12:54:56 +0530 Received: from d28relay07.in.ibm.com (d28relay07.in.ibm.com [9.184.220.158]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id DDDCDE005A for ; Fri, 5 Aug 2016 12:59:15 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay07.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u757OrZP36372720 for ; Fri, 5 Aug 2016 12:54:53 +0530 Received: from d28av01.in.ibm.com (localhost [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u757Opxi028688 for ; Fri, 5 Aug 2016 12:54:53 +0530 Date: Fri, 5 Aug 2016 12:54:50 +0530 From: Srikar Dronamraju To: Vlastimil Babka Cc: linux-mm@kvack.org, Mel Gorman , Michal Hocko , Andrew Morton , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, Mahesh Salgaonkar , Hari Bathini , Dave Hansen , Balbir Singh Subject: Re: [PATCH V2 1/2] mm/page_alloc: Replace set_dma_reserve to set_memory_reserve Reply-To: Srikar Dronamraju References: <1470330729-6273-1-git-send-email-srikar@linux.vnet.ibm.com> <09d5b30e-5956-bf64-5f4c-ea5425d7f7a5@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 In-Reply-To: <09d5b30e-5956-bf64-5f4c-ea5425d7f7a5@suse.cz> Message-Id: <20160805072450.GE11268@linux.vnet.ibm.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , * Vlastimil Babka [2016-08-05 08:45:03]: > >@@ -5493,10 +5493,10 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat) > > } > > > > /* Account for reserved pages */ > >- if (j == 0 && freesize > dma_reserve) { > >- freesize -= dma_reserve; > >+ if (j == 0 && freesize > nr_memory_reserve) { > > Will this really work (together with patch 2) as intended? > This j == 0 means that we are doing this only for the first zone, which is > ZONE_DMA (or ZONE_DMA32) on node 0 on many systems. I.e. I don't think it's > really true that "dma_reserve has nothing to do with DMA or ZONE_DMA". > > This zone will have limited amount of memory, so the "freesize > > nr_memory_reserve" will easily be false once you set this to many gigabytes, > so in fact nothing will get subtracted. > > On the other hand if the kernel has both CONFIG_ZONE_DMA and > CONFIG_ZONE_DMA32 disabled, then j == 0 will be true for ZONE_NORMAL. This > zone might be present on multiple nodes (unless they are configured as > movable) and then the value intended to be global will be subtracted from > several nodes. > > I don't know what's the exact ppc64 situation here, perhaps there are indeed > no DMA/DMA32 zones, and the fadump kernel only uses one node, so it works in > the end, but it doesn't seem much robust to me? > At the page initialization time, powerpc seems to have just one zone spread across the 16 nodes. >>From the dmesg. [ 0.000000] Memory hole size: 0MB [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000000000000-0x00001f5c8fffffff] [ 0.000000] DMA32 empty [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000000000-0x000001fb4fffffff] [ 0.000000] node 1: [mem 0x000001fb50000000-0x000003fa8fffffff] [ 0.000000] node 2: [mem 0x000003fa90000000-0x000005f9cfffffff] [ 0.000000] node 3: [mem 0x000005f9d0000000-0x000007f8efffffff] [ 0.000000] node 4: [mem 0x000007f8f0000000-0x000009f81fffffff] [ 0.000000] node 5: [mem 0x000009f820000000-0x00000bf77fffffff] [ 0.000000] node 6: [mem 0x00000bf780000000-0x00000df6dfffffff] [ 0.000000] node 7: [mem 0x00000df6e0000000-0x00000ff63fffffff] [ 0.000000] node 8: [mem 0x00000ff640000000-0x000011f58fffffff] [ 0.000000] node 9: [mem 0x000011f590000000-0x000013644fffffff] [ 0.000000] node 10: [mem 0x0000136450000000-0x00001563afffffff] [ 0.000000] node 11: [mem 0x00001563b0000000-0x000017630fffffff] [ 0.000000] node 12: [mem 0x0000176310000000-0x000019625fffffff] [ 0.000000] node 13: [mem 0x0000196260000000-0x00001b5dcfffffff] [ 0.000000] node 14: [mem 0x00001b5dd0000000-0x00001d5d2fffffff] [ 0.000000] node 15: [mem 0x00001d5d30000000-0x00001f5c8fffffff] The config has the below. CONFIG_ZONE_DMA32=y CONFIG_HIGH_RES_TIMERS=y CONFIG_ZONE_DMA_FLAG=1 CONFIG_FORCE_MAX_ZONEORDER=9 CONFIG_ZONE_DMA=y I tried forcing CONFIG_ZONE_DMA to be not set, but make always pick it. >>From source arch/powerpc/Kconfig marks CONFIG_ZONE_DMA as "default y" -- Thanks and Regards Srikar Dronamraju