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 9F903ECAAA1 for ; Mon, 31 Oct 2022 14:32:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0B5EF6B0071; Mon, 31 Oct 2022 10:32:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 03EA56B0073; Mon, 31 Oct 2022 10:32:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DFA686B0074; Mon, 31 Oct 2022 10:32:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B43AA6B0071 for ; Mon, 31 Oct 2022 10:32:38 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 5E15E14029F for ; Mon, 31 Oct 2022 14:32:38 +0000 (UTC) X-FDA: 80081485596.01.FF9F129 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf15.hostedemail.com (Postfix) with ESMTP id A385CA0011 for ; Mon, 31 Oct 2022 14:32:36 +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 D944E1F893; Mon, 31 Oct 2022 14:32:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1667226754; 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=wVoDxS6PUHIpxcricZG+zBeWGoABJesgtPBdPuIWxgs=; b=ADVD/L1pGDvFfcekCmppTqkmXcU+rjMdYyhg8mHnsMS8svmtsz6Elc3Var2Zm60DaTjzoz 6VshnsOVVIjhaLCLy9tavEkU8kFcf/5vobuAXe9oB1vvFXbqCdLYKQHoHXV6HPx6Go37d8 /dHwaSMM3TO2m2wVYZeeokpupX5y/hs= 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 BACA213451; Mon, 31 Oct 2022 14:32:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6UZZK4LcX2MhfQAAMHmgww (envelope-from ); Mon, 31 Oct 2022 14:32:34 +0000 Date: Mon, 31 Oct 2022 15:32:34 +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: <87wn8lkbk5.fsf@yhuang6-desk2.ccr.corp.intel.com> <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; imf15.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="ADVD/L1p"; spf=pass (imf15.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=1667226757; a=rsa-sha256; cv=none; b=x7ApP/oklj0EBfT2EH3F7xwYCXUdeyqAH3Mq8PtV1efMXa9yJHDBX1K3ass8SvMIZ+Z09l doCqPYoGmxcU3JV17GRil9T4dNY2shwQIbnJu2NHs019xRNZoNboQuAcqSAWx7BIhUEnHD 3SRFm4n2mMOJNKNNkcVPeAE9eNKwSzY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667226757; 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=wVoDxS6PUHIpxcricZG+zBeWGoABJesgtPBdPuIWxgs=; b=NEiRSUEZTYgAevs18xTOU4eJGXHZkSh+bWpjCgNiHZBX4cWXP2ZRhoLLt2Rs6VYgKEBAo+ HupAjEe0X/4KS4lRPybrma60LSgrPPWdVTv0OO7kBYC5xSq6UZ42RJhwfvf0D4Va6kx/Tt 0TCORmJMnnM98Hr2M6VgizKdMUSbEL8= X-Rspam-User: Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="ADVD/L1p"; spf=pass (imf15.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: rspam07 X-Stat-Signature: mnnyyt6trskeioc4eycge4w1nhx13f64 X-Rspamd-Queue-Id: A385CA0011 X-HE-Tag: 1667226756-78570 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 31-10-22 22:09:15, Feng Tang wrote: > On Mon, Oct 31, 2022 at 04:40:15PM +0800, Michal Hocko wrote: > > On Fri 28-10-22 07:22:27, Huang, Ying wrote: > > > Michal Hocko writes: > > > > > > > On Thu 27-10-22 17:31:35, Huang, Ying wrote: > > [...] > > > >> I think that it's possible for different processes have different > > > >> requirements. > > > >> > > > >> - Some processes don't care about where the memory is placed, prefer > > > >> local, then fall back to remote if no free space. > > > >> > > > >> - Some processes want to avoid cross-socket traffic, bind to nodes of > > > >> local socket. > > > >> > > > >> - Some processes want to avoid to use slow memory, bind to fast memory > > > >> node only. > > > > > > > > Yes, I do understand that. Do you have any specific examples in mind? > > > > [...] > > > > > > Sorry, I don't have specific examples. > > > > 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. > We've got bug reports from different channels > about using cpuset+docker to control meomry placement in memory tiering > system, leading to 2 commits solving them: > > 2685027fca38 ("cgroup/cpuset: Remove cpus_allowed/mems_allowed setup in > cpuset_init_smp()") > https://lore.kernel.org/all/20220419020958.40419-1-feng.tang@intel.com/ > > 8ca1b5a49885 ("mm/page_alloc: detect allocation forbidden by cpuset and > bail out early") > https://lore.kernel.org/all/1632481657-68112-1-git-send-email-feng.tang@intel.com/ > > >From these bug reports, I think it's reasonable to say there are quite > some real world users using cpuset+docker+memory-tiering-system. I don't think anybody is questioning existence of those usecases. The primary question is whether any of them really require any non-trivial (read nodemask aware) demotion policies. In other words do we know of cpuset policy setups where demotion fallbacks are (partially) excluded? -- Michal Hocko SUSE Labs