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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE7FDC04FDE for ; Fri, 9 Dec 2022 21:16:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229865AbiLIVQN (ORCPT ); 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: 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