Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2586413yba; Mon, 15 Apr 2019 15:09:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqycQHxgNhF3FZqgXd7EInP8aX/rQ3/MMrplH3chM7FGrv0bxxlp2McEoIC12RcGphHPod8X X-Received: by 2002:a17:902:f08a:: with SMTP id go10mr75593138plb.121.1555366155319; Mon, 15 Apr 2019 15:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555366155; cv=none; d=google.com; s=arc-20160816; b=UIL054ITVGgmhUsGGDq1fJ1UE/MBUmqlYDE4WMAN12p5Bp4mFLMK5P8iEYkoomWw9O 3nwzMyYoKmuBgVlBF2gcio6HqOVy8urRVUrY0UZe2p1ZBZeHoO8E+goQDjqYA2sAX5uJ 9STOv48ld8NP8QCaCJW8IeAclTqO382Z7MucidB3zwmd8hRDMr5S85AcnpLndwMAoXCC yfQPKtWdaQY8vek/xzOufL2mXgcZSRL2bRQoicGoL3/0kSV1HW2FyQgR4HeLc7Y01opt HJajybG7LU3tZYrXaqSxjojk4P0PgUiMt+yoPvUJ0ZumM+wSFDP+KKzaFZzVRHlKBYSZ Edvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=yi1hb0QSpiRsbPVKNnaHPa/zZN7ZBbOpc0clvUL0Uak=; b=HfMYg4IL/4idquijHI5bqRA5v5yAamzk4586V9v9dJQh/6FQXkxU523JJYxbZ1p+zD f8WYmhoMGX5NV/URkBHm6yFw5cjaWxwoFppNED5HG2UmeNn/xVgJKBEVcdKnzxSXlQ3Q fwYHED9yECSQx5ZTLDQFfcdfvg5XlxjLkNYuBzUSEaKeKaHUhrTiwEEnViPbGvyPCkfn fZODFBntB673ddn1WS7LgVlZZ7eWhRS1SDJQn6tIPYGsbxznlezvHDteBcupQpXDGyqb ee/olGN7eWpCwtjakShBIUZHzoo6X9YArs8SwZBjtiCJuLqiTF9yBJMkdOs18NV2+Bp/ hnLQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 32si42551120pgv.387.2019.04.15.15.08.57; Mon, 15 Apr 2019 15:09:15 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728080AbfDOWGj (ORCPT + 99 others); Mon, 15 Apr 2019 18:06:39 -0400 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:53134 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725786AbfDOWGj (ORCPT ); Mon, 15 Apr 2019 18:06:39 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R771e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07487;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---0TPPk8ij_1555365992; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0TPPk8ij_1555365992) by smtp.aliyun-inc.com(127.0.0.1); Tue, 16 Apr 2019 06:06:35 +0800 Subject: Re: [v2 PATCH 7/9] mm: vmscan: check if the demote target node is contended or not To: Dave Hansen , mhocko@suse.com, mgorman@techsingularity.net, riel@surriel.com, hannes@cmpxchg.org, akpm@linux-foundation.org, keith.busch@intel.com, dan.j.williams@intel.com, fengguang.wu@intel.com, fan.du@intel.com, ying.huang@intel.com, ziy@nvidia.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1554955019-29472-1-git-send-email-yang.shi@linux.alibaba.com> <1554955019-29472-8-git-send-email-yang.shi@linux.alibaba.com> <6d40d60e-dde4-7d70-c7a8-1a444c70c3ff@intel.com> From: Yang Shi Message-ID: <5082655c-6a24-a3d7-1b7d-bb256597890c@linux.alibaba.com> Date: Mon, 15 Apr 2019 15:06:27 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <6d40d60e-dde4-7d70-c7a8-1a444c70c3ff@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/11/19 9:06 AM, Dave Hansen wrote: > On 4/10/19 8:56 PM, Yang Shi wrote: >> When demoting to PMEM node, the target node may have memory pressure, >> then the memory pressure may cause migrate_pages() fail. >> >> If the failure is caused by memory pressure (i.e. returning -ENOMEM), >> tag the node with PGDAT_CONTENDED. The tag would be cleared once the >> target node is balanced again. >> >> Check if the target node is PGDAT_CONTENDED or not, if it is just skip >> demotion. > This seems like an actively bad idea to me. > > Why do we need an *active* note to say the node is contended? Why isn't > just getting a failure back from migrate_pages() enough? Have you > observed this in practice? The flag will be used to check if the target node is contended or not before moving the page into the demotion list. If the target node is contended (i.e. GFP_NOWAIT would likely fail), the page reclaim code even won't scan anonymous page list on swapless system. It will just try to reclaim page cache. This would save some scanning time. Thanks, Yang