Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753174AbcD2G5I (ORCPT ); Fri, 29 Apr 2016 02:57:08 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:40509 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752819AbcD2G5G (ORCPT ); Fri, 29 Apr 2016 02:57:06 -0400 X-Original-SENDERIP: 156.147.1.127 X-Original-MAILFROM: iamjoonsoo.kim@lge.com X-Original-SENDERIP: 10.177.222.138 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Fri, 29 Apr 2016 15:57:12 +0900 From: Joonsoo Kim To: Rui Teng Cc: Andrew Morton , Rik van Riel , Johannes Weiner , mgorman@techsingularity.net, Laura Abbott , Minchan Kim , Marek Szyprowski , Michal Nazarewicz , "Aneesh Kumar K.V" , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/6] mm/page_alloc: recalculate some of zone threshold when on/offline memory Message-ID: <20160429065712.GB19896@js1304-P5Q-DELUXE> References: <1461561670-28012-1-git-send-email-iamjoonsoo.kim@lge.com> <1461561670-28012-2-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1802 Lines: 48 On Thu, Apr 28, 2016 at 03:46:33PM +0800, Rui Teng wrote: > On 4/25/16 1:21 PM, js1304@gmail.com wrote: > >From: Joonsoo Kim > > > >Some of zone threshold depends on number of managed pages in the zone. > >When memory is going on/offline, it can be changed and we need to > >adjust them. > > > >This patch add recalculation to appropriate places and clean-up > >related function for better maintanance. > > > >Signed-off-by: Joonsoo Kim > >--- > > mm/page_alloc.c | 36 +++++++++++++++++++++++++++++------- > > 1 file changed, 29 insertions(+), 7 deletions(-) > > > >diff --git a/mm/page_alloc.c b/mm/page_alloc.c > >index 71fa015..ffa93e0 100644 > >--- a/mm/page_alloc.c > >+++ b/mm/page_alloc.c > >@@ -4633,6 +4633,8 @@ int local_memory_node(int node) > > } > > #endif > > > >+static void setup_min_unmapped_ratio(struct zone *zone); > >+static void setup_min_slab_ratio(struct zone *zone); > > #else /* CONFIG_NUMA */ > > > > static void set_zonelist_order(void) > >@@ -5747,9 +5749,8 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat) > > zone->managed_pages = is_highmem_idx(j) ? realsize : freesize; > > #ifdef CONFIG_NUMA > > zone->node = nid; > >- zone->min_unmapped_pages = (freesize*sysctl_min_unmapped_ratio) > >- / 100; > >- zone->min_slab_pages = (freesize * sysctl_min_slab_ratio) / 100; > >+ setup_min_unmapped_ratio(zone); > >+ setup_min_slab_ratio(zone); > > The original logic use freesize to calculate the > zone->min_unmapped_pages and zone->min_slab_pages here. > But the new function will use zone->managed_pages. > Do you mean the original logic is wrong, or the managed_pages will > always be freesize when CONFIG_NUMA defined? managed_pages will always be freesize so no problem. Thanks.