Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2596677yba; Mon, 15 Apr 2019 15:24:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8aItLaLdQFtN9WdkIRkkR/MECWDmOTBT+UsjTn3l8gas5BPQpgWkNUaP2eq9EotrXmT/o X-Received: by 2002:a62:e304:: with SMTP id g4mr72820467pfh.71.1555367078462; Mon, 15 Apr 2019 15:24:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555367078; cv=none; d=google.com; s=arc-20160816; b=P6cwJjG32JGHk11HNeMVSx6GgdtcK3U/pSXB++/BmPfTHVqqzoLPielnpgLe0bO5mS 4kcQDMBorKu/LEoQLRVZ70XlFiykVFmcqOaMGyoqLUZiQHAlJ3Eg7bnylQsUJ6Nc4mio rlWrF2ibAkq6fFcUnNG8rUFC0JtyvZy/vdvVJD+YbXz5zGzocq+wf3wHMoNuLrKG+cyV A/v5mDz6zk5Bs+WEPD3xOCSQ0BSxlHbHXeBpeTkY5uOLk3DgsSnnFpAQgh5BuXMS4Adc sesdBGR6ZNbJZtMefWint4dKfCFTeflPqN6Zvd21j6m3RhLiXDt2IfbRkrNCcx5B/GLV VaPA== 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=U8TY3oMt0a59WVcz9zJoEZ3/Cn5RPbJTBJxZwWbASXM=; b=vx25TF54t+D/2fo7ifBar1+e+22FRp1cx39gCtIWYAJJxWX1QK7w0Rd7asGKZsoz6r drlzGBW6X+n1Di9pUREZKGuVcRkVJG0vQ8fzmPw+lp+AUlRui0TuQ809oG54ezS79k/g 0IhR26oy/j/FaqNucNA51ni1wrIcxTBAw1CgmzRSkbA3HD7DCoYIgsMPwkgRNPMqv134 TbFKV4t6TSdeV+FnUvqUkYSMLa9XkgpSrpPNLWrp9ZM8nKFCOZMscvENKNq575AvRR/c h7+u8YrI203/8hvzVPQ2877YV0p+i9GirIHTsImEXQqF+ziWzk+l6t0a1DtXg81QdjbB ahDw== 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 o11si12671582plk.413.2019.04.15.15.24.21; Mon, 15 Apr 2019 15:24:38 -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 S1727760AbfDOWXj (ORCPT + 99 others); Mon, 15 Apr 2019 18:23:39 -0400 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]:36521 "EHLO out30-131.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726093AbfDOWXj (ORCPT ); Mon, 15 Apr 2019 18:23:39 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---0TPPkBEu_1555367013; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0TPPkBEu_1555367013) by smtp.aliyun-inc.com(127.0.0.1); Tue, 16 Apr 2019 06:23:36 +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> <5082655c-6a24-a3d7-1b7d-bb256597890c@linux.alibaba.com> <9bcf765c-c051-9086-b3fe-679adbe239cb@intel.com> From: Yang Shi Message-ID: <1b317d9a-406f-78c4-c2dd-d4c41eef8cc6@linux.alibaba.com> Date: Mon, 15 Apr 2019 15:23:28 -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: <9bcf765c-c051-9086-b3fe-679adbe239cb@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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/15/19 3:13 PM, Dave Hansen wrote: > On 4/15/19 3:06 PM, Yang Shi wrote: >>> 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. > That seems like the actual problem that needs to get fixed. > > On systems where we have demotions available, perhaps we need to start > scanning anonymous pages again, at least for zones where we *can* demote > from them. But the problem is if we know the demotion would likely fail, why bother scanning anonymous pages again? The flag will be cleared by the target node's kswapd once it gets balanced again. Then the anonymous pages would get scanned next time.