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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49FD3C4332F for ; Fri, 9 Dec 2022 21:16:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DAAF38E0005; Fri, 9 Dec 2022 16:16:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D5B438E0001; Fri, 9 Dec 2022 16:16:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C23248E0005; Fri, 9 Dec 2022 16:16:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id B08B88E0001 for ; Fri, 9 Dec 2022 16:16:13 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 88D1980287 for ; Fri, 9 Dec 2022 21:16:13 +0000 (UTC) X-FDA: 80224025826.05.E4F7318 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf14.hostedemail.com (Postfix) with ESMTP id 87EB4100009 for ; Fri, 9 Dec 2022 21:16:10 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=cv06Go4l; spf=pass (imf14.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670620570; a=rsa-sha256; cv=none; b=71pswTOP4qZbrvD8jyWL1BvSSNf/53ThpYuNVTGEaWfPs0yD6DbMyIkklvUebLkZQGaMDh gXHMhT19tQz6BZj7tLCKSpaU/73JU9vkDEP6W2hKZLNLEVnblssn6ugRfc/t3RWdNvfBRJ KwCSvl6quxw+bnTolhyVzzEFbKo2yDw= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=cv06Go4l; spf=pass (imf14.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670620570; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Y5KOnG0U3PKiJqceJhvbuDIcDatEOFXG6UTl/UXN4Oc=; b=yBxIew7c9BiHWhbOES7NZ8xw/Up6YpAi7IykWhOHdh/nGBQMB6PbtdSXp+jF6u8+Ph2CLO /QlynJqXBfE/cKVHU+grXufeml/KGzj2eZwju+GpBgMR3q1ve5yhKjiNcTDmVnJBMuCN/9 Zo05DdmxtdZuaGI9D5MkE/CzW1LjESI= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E4644205A2; Fri, 9 Dec 2022 21:16:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1670620568; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Y5KOnG0U3PKiJqceJhvbuDIcDatEOFXG6UTl/UXN4Oc=; b=cv06Go4lGtBq+ZOboQVPHKaqQt5NmZ3MiRJuSvs5xEM9egf/+87cT+53lST1PE7YXkvLhf wxsz3yanRR2P5fKPt+79LscZF8NgT8oNwhAklxwLa5hYPTUbqhReIP7tLxWh0z9cJFm6nM 9/cdLD2iTkmRb1LbqTjbYT7fDJqCToo= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C2AAC138E0; Fri, 9 Dec 2022 21:16:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id HBbDLJilk2PZPAAAMHmgww (envelope-from ); Fri, 09 Dec 2022 21:16:08 +0000 Date: Fri, 9 Dec 2022 22:16:08 +0100 From: Michal Hocko To: Wei Xu 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 Subject: Re: [PATCH v3] [mm-unstable] mm: Fix memcg reclaim on memory tiered systems Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Queue-Id: 87EB4100009 X-Rspamd-Server: rspam01 X-Stat-Signature: hmfujtis7pjt1u4xgzcawi4jqbwa9zdt X-HE-Tag: 1670620570-484371 X-HE-Meta: U2FsdGVkX19nt8jRoXsyLVfwtb7VE9rXj4+7vwPrTiOFLoUItn2jgviQltCIYBw2FLnfqHMvxI/kCvfPW0fzBshRIyCWh1E/NxcVQi8fRmLABm5fAYICpoMSO+lalIKMju0QZWmjyxty7F7dqFh7lhWcVJfMwpaNdjEPUdZtwnf1l3G52IBE7ZMv3Ik4Lb11nmos/Vi9SY+txq7ElDmhp7hI7dg4yO7Ldh2onh3vxNXDNuazjlaYZIksALhoG5kSnkEZeHLbg3MgaeZyGxfwO9GZwI6AMSzXAxL+U+cbiadwaB+v6XsuOY4kilbrDHqo6BfLwjcujdLppqa94ufnnILO97ng9dgl2hLHEpXix4ufLNYrpHvoOTZm6SuEW4OUvWP2SeY2GVbtCMX3F+hmIaDkEEwsNlRoShiIMeeDDSwaThTuQCTBRgr2boSniYCCCKscY+qibMm/3/EzzLag+ZBHUqqsyf1kR5AZwQeg7Z9T4X05bFacOxro9wJv63CF5HTsg4H+iLBcYLDXbFpXuYQJWu4+/BzajlYRvczBviEcKVmRSxYB/zUtFMNXnxDJ7fEul7VrtZfcJNF3THjhJK/oazJor+C/tAuyeU7d/er8h6zrkiQ+37Rzju2ufmKYaqWw6tyxuMDpuXkx0+8ZSGRe5LRSfAKxSfm1taHWi3I5uA6bDsRPGfEOEPlhJuHHZoPR5FIStQLmr+bLZeBLdr1EzpHWV5klSgT2QBYmsy6+R8irgvAxOIfr+S/o4bSSa+3VWkiUI3fbhDFbg13oxzW6t2EP5QKvMw2KqGfDVI7szviOuZZDKzhfWwHZSqJLQFlgOAUUYChoD9fy17ulbAkV61+CJGA8FMSIbFSjHgt5rbX5GACgLg== 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 09-12-22 08:41:47, Wei Xu wrote: > 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? I am not sure I follow. Could you be more specific please? > 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. This should be addressed by http://lkml.kernel.org/r/Y5B1K5zAE0PkjFZx@dhcp22.suse.cz, no? -- Michal Hocko SUSE Labs