Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1409014rwb; Mon, 7 Nov 2022 01:03:28 -0800 (PST) X-Google-Smtp-Source: AMsMyM4aYLqUMRkkct9hWhe04DyGpV0shbHf9mV943Jmv4ngXL3ZILnLdJ8KKHzH2eNcVY03rZov X-Received: by 2002:a17:906:7945:b0:73b:e605:f31 with SMTP id l5-20020a170906794500b0073be6050f31mr47531659ejo.129.1667811808779; Mon, 07 Nov 2022 01:03:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667811808; cv=none; d=google.com; s=arc-20160816; b=p9hHcFLwLcv3GgNCkf4PN5tAWiOEg1CRXXlTjuJuhy8kvhHAtEcN3DD8GOML3gINuB iyqgz+bK9qg8hH0F0scd9KbTWlQLPkTIb01NrAo08qJ9qeMw0zTnGr4fZF7LufiQiXlX yINzEn87QlDxVXqxzKNEYK1Ick32M9YI4EEn6Bppv3yeduSk5eskFBwR6K1kIh+3s/xH diXlEaIha2JODR8ajbBPAFjEgd/ALJ1uZ1wS8e3z2Mo93MjwxoVkTVi09bbm7Fpqaa0D QWBTcYD5MJfkgedHzSE7mE1YzSWbDBRHNRY3f+i/ZeXbS8vpaUvnDOIlP6/jyqv6USS1 hVNw== 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=yhWHJ2J3mSTc7a4l8DLtwjtj9XcPdTj9FcFSpoWpr2c=; b=CHZXUCCK//BvLq5Udcaf3QT8JhwNmd1OvP6/IongHLOxaxUtpfBXSjhwmLsfwoljlH i7c0c6DigGCBN9ImAgK/79/XdtrUeX1oqf1Mhd2noZyW4QGlLeOP76CK8m4mJdvFsxoe 20XYvDmNroLstvlBEUs6SaCBvhhSJtp0XDzfFjHaThxsVV4w8A4/OQp73ymJ1gR/wRJ6 UtH91baJXF+z4IwZpGpgnRx+/tFKzn8uJfMpJ9sAZdXzgsjYcO5/UAaQHW/t2dls8QSn 0D6tSn1qAULhCz2dx1Cj/4NpGZ82vLNPvlE1aeIxbivDCnOMPVT4KbOWJ3yCmnyZwJmf 6PBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=t8ZU6zp1; 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 hv13-20020a17090760cd00b007add164bc81si6107202ejc.222.2022.11.07.01.03.02; Mon, 07 Nov 2022 01:03:28 -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=t8ZU6zp1; 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 S229990AbiKGIRl (ORCPT + 95 others); Mon, 7 Nov 2022 03:17:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbiKGIRj (ORCPT ); Mon, 7 Nov 2022 03:17:39 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12D40B7FF; Mon, 7 Nov 2022 00:17:39 -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 C07A11F88F; Mon, 7 Nov 2022 08:17:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1667809057; 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=yhWHJ2J3mSTc7a4l8DLtwjtj9XcPdTj9FcFSpoWpr2c=; b=t8ZU6zp1GfpIYKpTERHBEmxxZa1ZI6WSDt+HtNFMqEM9YuuAhN7Wf8M0WRha9BmexJQ1Hx BeGVslsxal3j4CZgzDRp2e2bavLZV1suFz3jlmJaCyOpqMA6D0iyMIxDeAtZLOiFCJIZKX 37ufVDxAE4xTtaolcw6E4ze1Q1exgJI= 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 9EF4413AC7; Mon, 7 Nov 2022 08:17:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 9viDJCG/aGPWIwAAMHmgww (envelope-from ); Mon, 07 Nov 2022 08:17:37 +0000 Date: Mon, 7 Nov 2022 09:17:36 +0100 From: Michal Hocko To: Feng Tang Cc: "Huang, Ying" , Aneesh Kumar K V , Andrew Morton , Johannes Weiner , Tejun Heo , Zefan Li , Waiman Long , "linux-mm@kvack.org" , "cgroups@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Hansen, Dave" , "Chen, Tim C" , "Yin, Fengwei" Subject: Re: [PATCH] mm/vmscan: respect cpuset policy during page demotion Message-ID: References: <87o7txk963.fsf@yhuang6-desk2.ccr.corp.intel.com> <87fsf9k3yg.fsf@yhuang6-desk2.ccr.corp.intel.com> <87bkpwkg24.fsf@yhuang6-desk2.ccr.corp.intel.com> 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 Mon 07-11-22 16:05:37, Feng Tang wrote: > On Mon, Oct 31, 2022 at 03:32:34PM +0100, Michal Hocko wrote: > > > > OK, then let's stop any complicated solution right here then. Let's > > > > start simple with a per-mm flag to disable demotion of an address space. > > > > Should there ever be a real demand for a more fine grained solution > > > > let's go further but I do not think we want a half baked solution > > > > without real usecases. > > > > > > Yes, the concern about the high cost for mempolicy from you and Yang is > > > valid. > > > > > > How about the cpuset part? > > > > Cpusets fall into the same bucket as per task mempolicies wrt costs. Geting a > > cpuset requires knowing all tasks associated with a page. Or am I just > > missing any magic? And no memcg->cpuset association is not a proper > > solution at all. > > No, you are not missing anything. It's really difficult to find a > solution for all holes. And the patch is actually a best-efforts > approach, trying to cover cgroup v2 + memory controller enabled case, > which we think is a common user case for newer platforms with tiering > memory. Best effort is OK but it shouldn't create an unexpected behavior and this approach does that. I thought I have already explained that. But let me be more explicit this time. Please have a look at how controllers can be enabled/disabled at different levels of the hierarchy. Unless memcg grows a hard dependency on another controller (as it does with the blk io controller) then this approach can point to a wrong cpuset. See my point? Really, solution for this is not going to be cheap and also I am not sure all the hessles is really worth it until there is a clear usecase in sight. -- Michal Hocko SUSE Labs