Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3370530rwb; Fri, 9 Dec 2022 13:37:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf6TmwOHA2fhgFn4mf3wTeLbieXPcNLKSvpAR3F7petYrdjoFf3YfTMXGTrEvaw1dz6dIywx X-Received: by 2002:a05:6a20:7f9b:b0:aa:23cb:a1a6 with SMTP id d27-20020a056a207f9b00b000aa23cba1a6mr12992366pzj.0.1670621829869; Fri, 09 Dec 2022 13:37:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670621829; cv=none; d=google.com; s=arc-20160816; b=tUTz2nAkDHnIQk0QUfzlA5osdCGVWaGFjgTtO1CfAqf87WZM+XEFOzrRMB3wxq/NpI Vbw3mBMPdvdp9dAR8ZKi2L9cL+M3uIoUf9XjoRsbl9D0hDWpvA1ua69wtWihmok+JLHt lIObahdW3bOh1F/B8wab7loA/1CZZpIUOsTUqASsh3l2T4ky6GLbZcWAeBnme+fFNEzC AhKCPNvvSs32ct/Noz7odLiuOuETLoFh8Ev2+mglF2tChruwcUZSvvr23r3tRiBag24e Jhi6WiyO/o8xOj+v34T83EansGiTh9x5/XoedRvPCcWcVbvzEhE3wUUfCQkDsQTd78QQ q3UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Y5KOnG0U3PKiJqceJhvbuDIcDatEOFXG6UTl/UXN4Oc=; b=OHZ8y0j4SNGMKnXSGStwWSL+rp1XOJBmAfw4uBPOvch1gCWbzIF3AR2yrNl3/SQB+P xsblsXnCQIRV1R1TBeWpHxAGOEpM83BctZGuk+ZFahKoOPRYN+9IFVxAw+z/cbE3XhLC je0iIQbimyoPxyTBkOBpnO9QBewilXH8huKwwr8xyq2Ii17bfGQ5OTWsBQYxyMjEnMjS 57+s++6fR2edfa9OJ+LC/V0ueO3wkpjRLg8rJaG8is2EzvF5TvLSSjEpq1YvO4mYU9Iu SQ0/DD+EtuyaUZ94ifajZaVJSge/xALQxKro1O73M1fd2+UVEpHwZSfrZyWZZcoqV7SM MHmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=cv06Go4l; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v23-20020a63b957000000b00473c5330abbsi2453511pgo.158.2022.12.09.13.36.59; Fri, 09 Dec 2022 13:37:09 -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=@suse.com header.s=susede1 header.b=cv06Go4l; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229830AbiLIVQN (ORCPT + 74 others); Fri, 9 Dec 2022 16:16:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbiLIVQL (ORCPT ); Fri, 9 Dec 2022 16:16:11 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AC9423E8B for ; Fri, 9 Dec 2022 13:16:10 -0800 (PST) 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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 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