Received: by 10.213.65.68 with SMTP id h4csp1646855imn; Thu, 5 Apr 2018 01:01:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx48WMDOAG5HpLDgF9kT2cAKF8gIYbX5pJaOZixfVsgMzAyuRTzEml0uHSW+2mTz3yVx+cJ6r X-Received: by 10.167.130.22 with SMTP id k22mr16457039pfi.73.1522915308761; Thu, 05 Apr 2018 01:01:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522915308; cv=none; d=google.com; s=arc-20160816; b=KHz3KC6raZDopIjHFQQSY1ntIZxPJlpRwLYDJqEYRF/tIWXv5i5tWcDJgChy11SBIp lDXazpBEWFp0F8hgX2zaGVydbxJb+hVBcwOQ20Qu0LRB55aVHZ+HIRjw3vlcyaiJzY0y 8lo5qaEkWChi7t+fs/78irxm31qZvgTcYjYAGxcn4+AbEG9bYEALRzUTuADQPYTG+37h 9jaAAUMYD5hmXU5UsjPkPviF6XyPDtI/Oi1M5DDXOUyFiiMt/axS0mW5+Vah3HJbCBin yE9zkLHN5sZr2cdYt8rxUwxJ68i9YlTTXMxo6kXfGsMKmfxqJ++e/FCkDN1/uCTo4W5r UwJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=WxGPWVMzV60hGf0fCwoiHN5cF63eIXSTG1hH666wQsM=; b=ghvLJtVm0wPluXLXDtr60P3I/R95n6dVK0xQ6k0e9zpuxFjNn8cgMosxXy7rBjZiIt AH0ocJ2+c6tALN8583ACsveNw3lC5PTrQoplO6tRda+viSvOEZ6d3K6cGP1yhAkGHKhN Sh6K6SkvMNmKuxOOX6Bn40wrsZ86WzCCi2MXTz+ZgVuIHIqFUKlBx2XA4TvHWXBdZ/tQ VjyeJ/wVNyemp1WBrPtZo0fRl+jI9J0CQha0Nc2Lwe/wpl7rppWYdokf6ZoXRzI+jR2H VzGVa65PXLiOk6NMeymNnid4BVvph8SXkaRGKVlHzTU/KgcI3fguNW6qsc6XoXKIwHRu phUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z127si3786047pfb.397.2018.04.05.01.01.04; Thu, 05 Apr 2018 01:01:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751329AbeDEH55 (ORCPT + 99 others); Thu, 5 Apr 2018 03:57:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:45745 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751213AbeDEH55 (ORCPT ); Thu, 5 Apr 2018 03:57:57 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CF10EACC0; Thu, 5 Apr 2018 07:57:55 +0000 (UTC) Date: Thu, 5 Apr 2018 09:57:53 +0200 From: Michal Hocko To: js1304@gmail.com Cc: Andrew Morton , "Kirill A . Shutemov" , Mel Gorman , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joonsoo Kim Subject: Re: [PATCH] mm/thp: don't count ZONE_MOVABLE as the target for freepage reserving Message-ID: <20180405075753.GZ6312@dhcp22.suse.cz> References: <1522913236-15776-1-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1522913236-15776-1-git-send-email-iamjoonsoo.kim@lge.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 05-04-18 16:27:16, Joonsoo Kim wrote: > From: Joonsoo Kim > > ZONE_MOVABLE only has movable pages so we don't need to keep enough > freepages to avoid or deal with fragmentation. So, don't count it. > > This changes min_free_kbytes and thus min_watermark greatly > if ZONE_MOVABLE is used. It will make the user uses more memory. OK, but why does it matter. Has anybody seen this as an issue? > o System > 22GB ram, fakenuma, 2 nodes. 5 zones are used. > > o Before > min_free_kbytes: 112640 > > zone_info (min_watermark): > Node 0, zone DMA > min 19 > Node 0, zone DMA32 > min 3778 > Node 0, zone Normal > min 10191 > Node 0, zone Movable > min 0 > Node 0, zone Device > min 0 > Node 1, zone DMA > min 0 > Node 1, zone DMA32 > min 0 > Node 1, zone Normal > min 14043 > Node 1, zone Movable > min 127 > Node 1, zone Device > min 0 > > o After > min_free_kbytes: 90112 > > zone_info (min_watermark): > Node 0, zone DMA > min 15 > Node 0, zone DMA32 > min 3022 > Node 0, zone Normal > min 8152 > Node 0, zone Movable > min 0 > Node 0, zone Device > min 0 > Node 1, zone DMA > min 0 > Node 1, zone DMA32 > min 0 > Node 1, zone Normal > min 11234 > Node 1, zone Movable > min 102 > Node 1, zone Device > min 0 > > Signed-off-by: Joonsoo Kim > --- > mm/khugepaged.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/mm/khugepaged.c b/mm/khugepaged.c > index 5de1c6f..92dd4e6 100644 > --- a/mm/khugepaged.c > +++ b/mm/khugepaged.c > @@ -1880,8 +1880,16 @@ static void set_recommended_min_free_kbytes(void) > int nr_zones = 0; > unsigned long recommended_min; > > - for_each_populated_zone(zone) > + for_each_populated_zone(zone) { > + /* > + * We don't need to worry about fragmentation of > + * ZONE_MOVABLE since it only has movable pages. > + */ > + if (zone_idx(zone) > gfp_zone(GFP_USER)) > + continue; > + > nr_zones++; > + } > > /* Ensure 2 pageblocks are free to assist fragmentation avoidance */ > recommended_min = pageblock_nr_pages * nr_zones * 2; > -- > 2.7.4 > -- Michal Hocko SUSE Labs