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 D0C4DC433FE for ; Mon, 7 Nov 2022 08:17:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1B9A38E0003; Mon, 7 Nov 2022 03:17:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 169978E0001; Mon, 7 Nov 2022 03:17:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 058318E0003; Mon, 7 Nov 2022 03:17:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id E68178E0001 for ; Mon, 7 Nov 2022 03:17:39 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B8C8B1A0E3F for ; Mon, 7 Nov 2022 08:17:39 +0000 (UTC) X-FDA: 80105942238.21.E405EFC Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf25.hostedemail.com (Postfix) with ESMTP id 13D1CA0005 for ; Mon, 7 Nov 2022 08:17:38 +0000 (UTC) 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: ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=t8ZU6zp1; spf=pass (imf25.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=1667809059; a=rsa-sha256; cv=none; b=m/jSUNRFnpD6Y80Zn33e5YXHUEZmN1PAS6u5AZpf7CwkoZJPyvOyKZoQC8FV5TIVoehUYy w7pQ1d9py29a8Gh5CJGSNnyoP8MaXip5oSB/aQ23K5MvXnMplChMXX4D7bnBrcMrqwQxcJ iS/tx59QErcvKTYqIzDjPqEctBF6v4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667809059; 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=yhWHJ2J3mSTc7a4l8DLtwjtj9XcPdTj9FcFSpoWpr2c=; b=DZlpWClM6jW5U4zzZTm/9+bc9qXja9s1vEuF9wDa3mRRJUW3YCvLoFItwqRmg4wwn5WU9H /czi98y18iI1XMHqgcoW8xpc+Tulm24wxFPFzFktFKNx0kz39rJzadFjC/eCvJZrg08q3K h6D9ziDo10sXUBDq5bbuplEb3NbyNv8= X-Rspam-User: Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=t8ZU6zp1; spf=pass (imf25.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 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 13D1CA0005 X-Stat-Signature: d97bozw5aqbyu5m69dmjnbwx7r4hwtf5 X-HE-Tag: 1667809058-688522 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 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