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 32E54C4332F for ; Tue, 13 Dec 2022 13:43:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 943F18E0003; Tue, 13 Dec 2022 08:43:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F40C8E0002; Tue, 13 Dec 2022 08:43:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7BBAF8E0003; Tue, 13 Dec 2022 08:43:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 68A1C8E0002 for ; Tue, 13 Dec 2022 08:43:06 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 23207AAF0E for ; Tue, 13 Dec 2022 13:43:06 +0000 (UTC) X-FDA: 80237399172.06.B4B8F41 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by imf22.hostedemail.com (Postfix) with ESMTP id 52EC0C0008 for ; Tue, 13 Dec 2022 13:43:03 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=BhP7+cVf; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf22.hostedemail.com: domain of ying.huang@intel.com designates 192.55.52.136 as permitted sender) smtp.mailfrom=ying.huang@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670938984; 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=iFObNv7SXhRCOqsI0Mn0COs/Vc6CHXDFMLyv6UIK9wA=; b=daOpUlS+fbIgB9IKmpvmSUlFVIHizpeXpxCYYDS6AuEihOiTVS4Fwh1o2kxGAEu5eKGrCl lpMt3L8urh2D3Evm0AZGoYyMA1eu3Va5C9xw/MW8TVW1wJja2qJ872RgruQNQGsVi6kvQA hOhSkl34+ymcVv3m3SHRn2CR1qYiTTk= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=BhP7+cVf; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf22.hostedemail.com: domain of ying.huang@intel.com designates 192.55.52.136 as permitted sender) smtp.mailfrom=ying.huang@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670938984; a=rsa-sha256; cv=none; b=DlUgQ/NkIqYaPirsH2vtJIavkOCjJfOrcdqz2ygsRArG0G9fsAyWRuwEs/wPSUi9eFaq13 8Oy9FiknSjiayP1797/PJ0k8ymPkWm+zsiupD43ahypdaiZzOuK3zyvYBGDAIVlFifBgX0 BawIBjp1IlFffoWeZq7I126rBs8+q4I= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670938983; x=1702474983; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=XCQGGTjFZDCNegxIbrsrKbDLonWPRMS8SgLrOu3wwKk=; b=BhP7+cVfNkbuopFOZZHxN2lfuJFDjyxqtcNqTHQthTImAAMhRQB9iRBR TmIPG6HvdxLW4GLs+z/mrKMTLq08dNSM3+QxQN6km3NriDG8uY989ksf5 RJeUdLLolTH0M3Ka+BnS3x9ry/Cm4OlFWU+7D52ry1CGFhqga2gyx5+KA n7HPf1SDOd7+AIB5qGkOO6aVV4ysb3bIqWQy6EiZR9hRIRgZACm8kvqs5 joG/QCj+piEZZ1FlvNrAsYQ4H+HMaaIN6Y19L8RaoNw1yTuP3meh5hbvV LqScexPSuX7hvQOZwmaUmtowCfZqhObTIH0Qt7DI91nQrfH6lg1+9KjQV g==; X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="297810524" X-IronPort-AV: E=Sophos;i="5.96,241,1665471600"; d="scan'208";a="297810524" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2022 05:43:01 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="790936440" X-IronPort-AV: E=Sophos;i="5.96,241,1665471600"; d="scan'208";a="790936440" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2022 05:42:57 -0800 From: "Huang, Ying" To: Michal Hocko , Mina Almasry , weixugc@google.com Cc: Tejun Heo , Zefan Li , Johannes Weiner , Jonathan Corbet , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Yang Shi , Yosry Ahmed , fvdl@google.com, bagasdotme@gmail.com, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3] mm: Add nodes= arg to memory.reclaim In-Reply-To: (Michal Hocko's message of "Tue, 13 Dec 2022 09:51:27 +0100") References: <20221202223533.1785418-1-almasrymina@google.com> <87k02volwe.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Date: Tue, 13 Dec 2022 21:42:02 +0800 Message-ID: <87bko7h13p.fsf@yhuang6-desk2.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Rspamd-Queue-Id: 52EC0C0008 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: 517fmd5iti9c3u7w8m7yjnf6o3i467sn X-HE-Tag: 1670938983-628124 X-HE-Meta: U2FsdGVkX1/h3zS12NY+mmuiAS5EdgWDBljeZ+zSB9+rPWYDHVlyXUqm4JHIJVDOWdx1tkMdIHbuRaZzRT38sB32lPZEDLrnKhAJoENIkGLY5cf4C5wqv0HcnxALdNDjz6UDeubpPdF++OI/T6JQDBnl2GRuQNv4US48SbYD6539AwA7Cm1OP24HlaC0gycA1YEB97aEvPxWZocKBaq5T0X4leED4zq7E4zAXG2w+2XrqprRNcpB/wwOL96C5IsSy4AgYVZCryYSDnSdbC8DBXx/TKRw/0UVFwwu1lAEbX7w0oecb/IvgRIWlxxx1yH1355Xot6t/w2wgkdOHXB3CgKttHjk6hJDnBwY1Ym6xY3Kg896d+ObIfQjoINuGyOy6piByPxjZ25qv+OziqJhEd1VkDryIfkqwoOhwqPDAXddrYyL2pRemOnE0SlDB7xDdjCNwOW9RS5uBr3ROiYGx6X/K943/Mvkq990S4AoiwIrN9BuURyvIOZv58HTa/+/EW2j/MpwOjaHCQTZgS5HA2dZ+E4LEkrJ5D1PyeleCRagLAEfU4cXKf+x1uUkw3EZ+zbNgafyJEd8FHkyUpo9EhYA64lnV9abxBXMYE75OkR7sDq0FGhaLptQ3OhQio9DQavxS/ZqDYAF1tLtN/WFa5MQ5EWSzlyeDBq+gYDnTP1vs9VQOwVdjLmMxwi9eKN0dqUs45JVCLl8fR/T5w0XFTOm7KXulDj8CzRY4IpVpSTle00X9b7kbkY7IpMoTXo3jOynXJS39uWGq0cp66VhEZIti2CoHQCNRt06jW0wEE9rpDK+89eMbW1YFq4n512qy05u79Tr5xihpXq7DzfAA3RlwwVc9HH2BI1JUXcEWn4PNBkZkQEuLg== 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: Michal Hocko writes: > On Tue 13-12-22 14:30:57, Huang, Ying wrote: >> Mina Almasry writes: > [...] >> After these discussion, I think the solution maybe use different >> interfaces for "proactive demote" and "proactive reclaim". That is, >> reconsider "memory.demote". In this way, we will always uncharge the >> cgroup for "memory.reclaim". This avoid the possible confusion there. >> And, because demotion is considered aging, we don't need to disable >> demotion for "memory.reclaim", just don't count it. > > As already pointed out in my previous email, we should really think more > about future requirements. Do we add memory.promote interface when there > is a request to implement numa balancing into the userspace? Maybe yes > but maybe the node balancing should be more generic than bound to memory > tiering and apply to a more fine grained nodemask control. > > Fundamentally we already have APIs to age (MADV_COLD, MADV_FREE), > reclaim (MADV_PAGEOUT, MADV_DONTNEED) and MADV_WILLNEED to prioritize > (swap in, or read ahead) which are per mm/file. Their primary usability > issue is that they are process centric and that requires a very deep > understanding of the process mm layout so it is not really usable for a > larger scale orchestration. > The important part of those interfaces is that they do not talk about > demotion because that is an implementation detail. I think we want to > follow that model at least. From a higher level POV I believe we really > need an interface to age&reclaim and balance memory among nodes. Are > there more higher level usecases? Yes. If the high level interface can satisfy the requirements, we should use them or define them. But I guess Mina and Xu has some requirements at the level of memory tiers (demotion/promotion)? Best Regards, Huang, Ying