Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2999573rwb; Fri, 9 Dec 2022 08:45:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf7GL/nL+TJdDmTp6ond142Rb6/Purb6NFpHM+5Thu28F4l3A9IeqM+7KlKzISwonSF1VTyI X-Received: by 2002:a05:6a00:24cf:b0:576:1747:8525 with SMTP id d15-20020a056a0024cf00b0057617478525mr8226539pfv.15.1670604325875; Fri, 09 Dec 2022 08:45:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670604325; cv=none; d=google.com; s=arc-20160816; b=d6B+jSw0jKhNihuowSJ6+f5Sfs+SZ80es+kH4LYVExT2oVAESM5ouiMIaODXwXC0H3 FhTlacViShCHf5Tl5P1Bm62EcWLhIsIdHR6VEI+BFF6mBZI5kCgFMjDOo8vQO/7YgUKp +xkX/Aw+Bhdy8rZzm3DA8OojfDz15iDP77Pxr/3+frDaJZbkxxOIyzKDGh2xH9GoyYkc Hg5kjjwWHRUS64lGkiAwJvENfqzAVvsnLwgdlGegoMpFkWg6Ib0i68YcAXu0a1eJVVsU A5tbINzwf4zIfdudhswmP8YYwTy/VG20rFAQVdUdlb43D1Y6NSq7rGR1MDCTpIr9uvHI RHPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=i9EfDV7EBqWGFnaYDO/cpEuxlHa0WTqeQPcdpc0bkis=; b=0cshE2/dzK5JmpVpak4AboqmVFF3CRqKpJiEM8mzitNsiwyU8TwLEl0dHQlr0ZYhUf nriMuzOXbDwW/iAZqmsDBQdGBP1n41m240AeQHxYZD+IY02u9upp5J1/KcoDvaHx39F9 0TvxN7F0bJOmuZPH7VFDpCbJZ9xxqhCDVdcALYYHuJJ3xSHOtNasEtrxCaQOG7sOINgS qQUnVcV4KV+2kUR7S8JtbD+JNBRIdDXTNjIOYdyoG4+kcP5FneyzpeE3C2VBOh9M50CK 3PKNzE/aQutuMZcWvtrnKkwqrWF5u1I12pEq5u1R8yazSYvZNbjgskpKMqOOs6QiHQXC cy5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=kcLGQWVD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a13-20020aa7864d000000b00574e84f7ee7si1992187pfo.174.2022.12.09.08.45.15; Fri, 09 Dec 2022 08:45:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=kcLGQWVD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229728AbiLIQmC (ORCPT + 75 others); Fri, 9 Dec 2022 11:42:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbiLIQmB (ORCPT ); Fri, 9 Dec 2022 11:42:01 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFCC189307 for ; Fri, 9 Dec 2022 08:42:00 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id u15-20020a17090a3fcf00b002191825cf02so5514612pjm.2 for ; Fri, 09 Dec 2022 08:42:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=i9EfDV7EBqWGFnaYDO/cpEuxlHa0WTqeQPcdpc0bkis=; b=kcLGQWVDzGqnXIK2OUrhHfduI4saLmxlUlFxYA9TOx0BiOqjv8QeRv2rj6gheEKZQz 0llTw8X/KWAcHOngmarldA48AVKQPn+z1PmtohnnYihrZ8BpShW5/47uz2yu6AO1pUZp kGeZ1W0F83IyD+lEuWShFxFquSzpmZfN7w3CW7jBvVCit++L369DBisGLHumCA30U/xm CbvT8HwLVYkGLM/pfSv6n83X3ffWEpHZ6ZDA28a9VBmcVaEy65LD2brgEm4bjJo16hJ6 felu+EU0W3Kzk7v9K0gntBqoxsRvDeglbJGTr0ta4uVF5HWzFyUPTlTLAmdrrCDgDhwN S34w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=i9EfDV7EBqWGFnaYDO/cpEuxlHa0WTqeQPcdpc0bkis=; b=8QmQ/gL0hIVXqJR6QiXEI2WqjSwIaSmjJZvF2IKjjqA2eTBR9jqNarslUC+H+tiPmh t50zxWFBLGQmbZj2syx4Km/lT/2ZCkn89N+bBS4nCE+tc3UKcQVuYsArvkPTXXoFxiEb C8KM62h7Uf85hvtKvB9DohpgGB9jOtO/Wm6TEBvrIOqx/toktjGWt1eYbhhXsQylT3rS kQpysyTR763JhuTRkZt/wCiy8PLzdpaTtmMJEO+7xqVd6iFbLLdkOKK8E1KQkYN6fveW 9CsESx+lqV3s41nmp07CzVANZccWh01Pwz2q/yNvgEcsNxbQefw2zUiCHTC+foyQz0co EhnA== X-Gm-Message-State: ANoB5plM15Oqr9iLMxSgtBvAeZYXJ/QJ7JNAroM0PRSc+F09kBE1c/vT 3icXxkUqg9tboFMIsIzDLFBwHfl35lwnXcqOdUdxYw== X-Received: by 2002:a17:90a:5a41:b0:219:41ef:a812 with SMTP id m1-20020a17090a5a4100b0021941efa812mr51961934pji.153.1670604120017; Fri, 09 Dec 2022 08:42:00 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Wei Xu Date: Fri, 9 Dec 2022 08:41:47 -0800 Message-ID: Subject: Re: [PATCH v3] [mm-unstable] mm: Fix memcg reclaim on memory tiered systems To: Michal Hocko Cc: Mina Almasry , Andrew Morton , Johannes Weiner , Roman Gushchin , Shakeel Butt , Muchun Song , Huang Ying , Yang Shi , Yosry Ahmed , fvdl@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 9, 2022 at 12:08 AM Michal Hocko wrote: > > On Thu 08-12-22 16:59:36, Wei Xu wrote: > [...] > > > What I really mean is to add demotion nodes to the nodemask along with > > > the set of nodes you want to reclaim from. To me that sounds like a > > > more natural interface allowing for all sorts of usecases: > > > - free up demotion targets (only specify demotion nodes in the mask) > > > - control where to demote (e.g. select specific demotion target(s)) > > > - do not demote at all (skip demotion nodes from the node mask) > > > > For clarification, do you mean to add another argument (e.g. > > demotion_nodes) in addition to the "nodes" argument? > > No, nodes=mask argument should control the domain where the memory > reclaim should happen. That includes both aging and the reclaim. If the > mask doesn't contain any lower tier node then no demotion will happen. > If only a subset of lower tiers are specified then only those could be > used for the demotion process. Or put it otherwise, the nodemask is not > only used to filter out zonelists during reclaim it also restricts > migration targets. > > Is this more clear now? In that case, how can we request demotion only from toptier nodes (without counting any reclaimed bytes from other nodes), which is our memory tiering use case? Besides, when both toptier and demotion nodes are specified, the demoted pages should only be counted as aging and not be counted towards the requested bytes of try_to_free_mem_cgroup_pages(), which is what this patch tries to address. > -- > Michal Hocko > SUSE Labs