Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3037146rwb; Fri, 2 Dec 2022 20:36:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf73vkA9qPfU4eA9wgn4uSdvbxgOgLvfLYajdoTZfBbHN+1U3wQCSdNagPhj4KxmGDylE6kE X-Received: by 2002:a17:907:138d:b0:7bc:2ad:fae with SMTP id vs13-20020a170907138d00b007bc02ad0faemr35736853ejb.724.1670042160960; Fri, 02 Dec 2022 20:36:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670042160; cv=none; d=google.com; s=arc-20160816; b=qrnWcPqgLRzvbX5Bi4vBJsTSTwhxxI80CNUdIb5T8ryPXiJHV0+NnWrGIy6qvOil9d OjHWWPhD1nWsgGiyFePBZH7qGgS/FuqLWEvXa3zk6vc+1t5h7B7ZgP6xzp48+eUFdXUp Nnq/gY8Mdy/JPbqXqaOIiBOizOVaYTNHuGfPue2SgKgeBsK+Xd6Cfp7UnujWB2KZ08OV 8K2NBiyUJBBBe657uLxVXxBwbz/vs34gZFEi8GddZGwyohU+ZqlOS/Siewh0U4AQM6Lr H1p7NxTdMTMoGUmuLmNRySzjkqqeOgCzFYNeeJa4nlX3mQxOuI7htGklLYDfvJMDl+v9 8eQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=yB//b1EitRmLn+k+QyZlckrtyNyeyMWH9FzHsotPYVg=; b=qEWQYEc1DyRg/tkZTnDGOgxOCZqXo44kQhqfqGRreDjhRhhvKHKMLAR6NETfkIezQB fMqhYLSRCzp+bC0661I7aZU0iBvtnuQe2OBDRdwKawGT/fkcKl6rhya+oePQqbKH58SS ZPLHOPhAmZ43kMa7VfMTAtgJQwZOztVyyrjItbSz9q5TKD4MeCV3gbbkooC2iwnXxNa8 Hv5E18hxLRLPTUMhJotI8F3Xz3h/Mp2JLuLxCmhOBkRty1JsptPTDtDjyDNI2wvSwuBf YDi5SCFtUYaSCx5UqYfVshLWStWKJiJ4hRnR1fQrF4zmeN1jXaRF5VB4W5Fc95S0xqbH IigQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ubL93lHJ; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd20-20020a1709069b9400b007c0cb833639si2489532ejc.933.2022.12.02.20.35.14; Fri, 02 Dec 2022 20:36:00 -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=@linux.dev header.s=key1 header.b=ubL93lHJ; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230142AbiLCDXO (ORCPT + 82 others); Fri, 2 Dec 2022 22:23:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230071AbiLCDXM (ORCPT ); Fri, 2 Dec 2022 22:23:12 -0500 X-Greylist: delayed 337 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 02 Dec 2022 19:23:10 PST Received: from out-17.mta0.migadu.com (out-17.mta0.migadu.com [91.218.175.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9450627F7 for ; Fri, 2 Dec 2022 19:23:08 -0800 (PST) Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1670037449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yB//b1EitRmLn+k+QyZlckrtyNyeyMWH9FzHsotPYVg=; b=ubL93lHJgSTgz+3zzH+QSRUgMV/lU7i9P2hA234RwUQaM5sly2K9vbBgeWb0vwoGJBxdx/ glDZK10V70CZbf0v9q9CummWFes9OBw5TNB9xxhy8eM0hCnc5G10YopaPIL8WS7DzpnGzu 9hsfB3qvJ5n8shNfCGlcwXzjKpvzL18= Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) Subject: Re: [PATCH v3] mm: Add nodes= arg to memory.reclaim X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20221202223533.1785418-1-almasrymina@google.com> Date: Sat, 3 Dec 2022 11:17:10 +0800 Cc: Tejun Heo , Zefan Li , Johannes Weiner , Jonathan Corbet , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Huang Ying , Yang Shi , Yosry Ahmed , weixugc@google.com, fvdl@google.com, Michal Hocko , bagasdotme@gmail.com, cgroups@vger.kernel.org, Linux Doc Mailing List , linux-kernel@vger.kernel.org, Linux Memory Management List Content-Transfer-Encoding: quoted-printable Message-Id: References: <20221202223533.1785418-1-almasrymina@google.com> To: Mina Almasry X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Dec 3, 2022, at 06:35, Mina Almasry wrote: >=20 > The nodes=3D arg instructs the kernel to only scan the given nodes for > proactive reclaim. For example use cases, consider a 2 tier memory = system: >=20 > nodes 0,1 -> top tier > nodes 2,3 -> second tier >=20 > $ echo "1m nodes=3D0" > memory.reclaim >=20 > This instructs the kernel to attempt to reclaim 1m memory from node 0. > Since node 0 is a top tier node, demotion will be attempted first. = This > is useful to direct proactive reclaim to specific nodes that are under > pressure. >=20 > $ echo "1m nodes=3D2,3" > memory.reclaim >=20 > This instructs the kernel to attempt to reclaim 1m memory in the = second tier, > since this tier of memory has no demotion targets the memory will be > reclaimed. >=20 > $ echo "1m nodes=3D0,1" > memory.reclaim >=20 > Instructs the kernel to reclaim memory from the top tier nodes, which = can > be desirable according to the userspace policy if there is pressure on > the top tiers. Since these nodes have demotion targets, the kernel = will > attempt demotion first. >=20 > Since commit 3f1509c57b1b ("Revert "mm/vmscan: never demote for memcg > reclaim""), the proactive reclaim interface memory.reclaim does both > reclaim and demotion. Reclaim and demotion incur different latency = costs > to the jobs in the cgroup. Demoted memory would still be addressable > by the userspace at a higher latency, but reclaimed memory would need = to > incur a pagefault. >=20 > The 'nodes' arg is useful to allow the userspace to control demotion > and reclaim independently according to its policy: if the = memory.reclaim > is called on a node with demotion targets, it will attempt demotion = first; > if it is called on a node without demotion targets, it will only = attempt > reclaim. >=20 > Acked-by: Michal Hocko > Signed-off-by: Mina Almasry Acked-by: Muchun Song Thanks.=