Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp596804ybg; Thu, 19 Mar 2020 05:30:11 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt8K3+nCO7859NYBthLcYydtBGCR6ViDBb3I2qx0qlmO9emsutH3/KcSDrEsLDg+g8j0IhQ X-Received: by 2002:a05:6830:118d:: with SMTP id u13mr1967781otq.41.1584621011177; Thu, 19 Mar 2020 05:30:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584621011; cv=none; d=google.com; s=arc-20160816; b=rjOV/TLrVxDYn4tiXx8/gBZ8nxSHJPb61f7tHOIIMvXCtLxl5uqQTH9tdhfa+8oItN XBTnbLn/nBiPIthS774og9P80fEoR8wUypIHUh1mB5u6F5O/OdF6oOzYF18M+GXaFZoI YqeKR0WuFfiEHYRUov6dIhDL5Vo/IGJ0TRqFBvf+Ia3YCdnE6656ZvEBOabFgWiVbfZR kZm3kzJFg8FDdBvIi2A1xXYB3w1dNeCKuum4R+F0wLKPsHriXZmHsY5cqsXxoUA2Of3W tV970jxNblpW92pqStKy2pePdUEVWbplaJgvGeOuS+6SvPkwuZnf+sAuLH1SEsAy+mIm mMSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=8bXY4Ne0QOOZS9w1TH0LboYEsAsfStj/gt8v2z+5DA8=; b=urlzr4hoEnLGbqy6wv2BNrmmmL5+UZkwfJir0a0tnsthSjBTvkqoryWG97CvHkNini id7CY9oGl+Aib0ImY5AWPoBl9QhUACjmvMqiXKCTyz5B+GCMWXlEZLV8dn32/UGObt27 4ZSLHaoIsasdLfmVsWf8ZhEbAwFEwYhph+xOQpH6KJ5zRcLbV4vig8xVpaRwoL5FHP04 fupNnkRybcL7L2HalwuBZ0qsZqDAlRvnAMJzA5uUSEbeYv3Tm4VqM1Zi82YLTsPKT+b4 imTjzZcmlDOfjCGaKXELqCdFBw9owJ2ZATwx1npOjN25JTdqoqrusUM5yyGskd0bJ+TG Yc9A== 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 i19si1190625otp.177.2020.03.19.05.29.57; Thu, 19 Mar 2020 05:30:11 -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 S1727016AbgCSM3Y (ORCPT + 99 others); Thu, 19 Mar 2020 08:29:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:39450 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726793AbgCSM3Y (ORCPT ); Thu, 19 Mar 2020 08:29:24 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9E56CAAB8; Thu, 19 Mar 2020 12:29:21 +0000 (UTC) Subject: Re: [PATCH v2 1/2] mm/page_alloc: use ac->high_zoneidx for classzone_idx To: js1304@gmail.com, Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Johannes Weiner , Michal Hocko , Minchan Kim , Mel Gorman , kernel-team@lge.com, Ye Xiaolong , Joonsoo Kim References: <1584502378-12609-1-git-send-email-iamjoonsoo.kim@lge.com> <1584502378-12609-2-git-send-email-iamjoonsoo.kim@lge.com> From: Vlastimil Babka Message-ID: Date: Thu, 19 Mar 2020 13:29:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <1584502378-12609-2-git-send-email-iamjoonsoo.kim@lge.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/18/20 4:32 AM, js1304@gmail.com wrote: > From: Joonsoo Kim > > Currently, we use the zone index of preferred_zone which represents > the best matching zone for allocation, as classzone_idx. It has a problem > on NUMA system with ZONE_MOVABLE. > > In NUMA system, it can be possible that each node has different populated > zones. For example, node 0 could have DMA/DMA32/NORMAL/MOVABLE zone and > node 1 could have only NORMAL zone. In this setup, allocation request > initiated on node 0 and the one on node 1 would have different > classzone_idx, 3 and 2, respectively, since their preferred_zones are > different. If they are handled by only their own node, there is no problem. > However, if they are somtimes handled by the remote node due to memory > shortage, the problem would happen. > > In the following setup, allocation initiated on node 1 will have some > precedence than allocation initiated on node 0 when former allocation is > processed on node 0 due to not enough memory on node 1. They will have > different lowmem reserve due to their different classzone_idx thus > an watermark bars are also different. ... > Reported-by: Ye Xiaolong > Tested-by: Ye Xiaolong > Signed-off-by: Joonsoo Kim With the clarifications that David requested, Acked-by: Vlastimil Babka Thanks! > --- > mm/internal.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/internal.h b/mm/internal.h > index c39c895..aebaa33 100644 > --- a/mm/internal.h > +++ b/mm/internal.h > @@ -119,7 +119,7 @@ struct alloc_context { > bool spread_dirty_pages; > }; > > -#define ac_classzone_idx(ac) zonelist_zone_idx(ac->preferred_zoneref) > +#define ac_classzone_idx(ac) (ac->high_zoneidx) > > /* > * Locate the struct page for both the matching buddy in our >