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 1AE9BC4332F for ; Mon, 7 Nov 2022 08:17:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230214AbiKGIRn (ORCPT ); Mon, 7 Nov 2022 03:17:43 -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: 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