From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BDEBCA9ED0 for ; Fri, 1 Nov 2019 11:11:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E023620659 for ; Fri, 1 Nov 2019 11:11:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E023620659 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AA7C96B0005; Fri, 1 Nov 2019 07:11:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A31246B0006; Fri, 1 Nov 2019 07:11:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 91F496B0007; Fri, 1 Nov 2019 07:11:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0194.hostedemail.com [216.40.44.194]) by kanga.kvack.org (Postfix) with ESMTP id 6A9966B0005 for ; Fri, 1 Nov 2019 07:11:50 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 02C7783E0 for ; Fri, 1 Nov 2019 11:11:50 +0000 (UTC) X-FDA: 76107443580.02.plane80_6744b7dd33543 X-HE-Tag: plane80_6744b7dd33543 X-Filterd-Recvd-Size: 3174 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Fri, 1 Nov 2019 11:11:49 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B54B9B25F; Fri, 1 Nov 2019 11:11:47 +0000 (UTC) Date: Fri, 1 Nov 2019 11:11:45 +0000 From: Mel Gorman To: "Huang, Ying" Cc: Peter Zijlstra , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Michal Hocko , Rik van Riel , Ingo Molnar , Dave Hansen , Dan Williams , Fengguang Wu Subject: Re: [RFC 01/10] autonuma: Fix watermark checking in migrate_balanced_pgdat() Message-ID: <20191101111145.GN28938@suse.de> References: <20191101075727.26683-1-ying.huang@intel.com> <20191101075727.26683-2-ying.huang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20191101075727.26683-2-ying.huang@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Nov 01, 2019 at 03:57:18PM +0800, Huang, Ying wrote: > From: Huang Ying > > When zone_watermark_ok() is called in migrate_balanced_pgdat() to > check migration target node, the parameter classzone_idx (for > requested zone) is specified as 0 (ZONE_DMA). But when allocating > memory for autonuma in alloc_misplaced_dst_page(), the requested zone > from GFP flags is ZONE_MOVABLE. That is, the requested zone is > different. The size of lowmem_reserve for the different requested > zone is different. And this may cause some issues. > > For example, in the zoneinfo of a test machine as below, > > Node 0, zone DMA32 > pages free 61592 > min 29 > low 454 > high 879 > spanned 1044480 > present 442306 > managed 425921 > protection: (0, 0, 62457, 62457, 62457) > > The free page number of ZONE_DMA32 is greater than "high watermark + > lowmem_reserve[ZONE_DMA]", but less than "high watermark + > lowmem_reserve[ZONE_MOVABLE]". And because __alloc_pages_node() in > alloc_misplaced_dst_page() requests ZONE_MOVABLE, the > zone_watermark_ok() on ZONE_DMA32 in migrate_balanced_pgdat() may > always return true. So, autonuma may not stop even when memory > pressure in node 0 is heavy. > > To fix the issue, ZONE_MOVABLE is used as parameter to call > zone_watermark_ok() in migrate_balanced_pgdat(). This makes it same > as requested zone in alloc_misplaced_dst_page(). So that > migrate_balanced_pgdat() returns false when memory pressure is heavy. > > Signed-off-by: "Huang, Ying" Acked-by: Mel Gorman This patch is independent of the series and should be resent separately. Alternatively Andrew, please pick this patch up on its own. -- Mel Gorman SUSE Labs