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 E510EC4332F for ; Tue, 13 Dec 2022 08:51:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6EA738E0005; Tue, 13 Dec 2022 03:51:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 672AD8E0002; Tue, 13 Dec 2022 03:51:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 513CC8E0005; Tue, 13 Dec 2022 03:51:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 3A9178E0002 for ; Tue, 13 Dec 2022 03:51:33 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 596B7120CED for ; Tue, 13 Dec 2022 08:51:32 +0000 (UTC) X-FDA: 80236664424.06.4071D78 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf18.hostedemail.com (Postfix) with ESMTP id A254B1C000D for ; Tue, 13 Dec 2022 08:51:29 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=MfMJRehQ; spf=pass (imf18.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670921490; 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=cJqVpp0rgt2DpLfJteOt1+knopZ57BAnBRXhD56Saew=; b=O/5DFeO8vy9zIl5bxf7fDEMhUAAnqkZMrbuxAUgA5+4Jr0WNykeJWz3untX7wGrOcY1diC El/STOeiPtH1VUmTqXApitLdRzS1aeYVWqFgZ4NyHp6qg86Mtl7ARx72wvUdnXQEH/yT8x UnDGTD+B5I4fCVU/ZXIQP67VsFl9KYY= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=MfMJRehQ; spf=pass (imf18.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 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=1670921490; a=rsa-sha256; cv=none; b=8oS1ehUulGQRt1K/6Dv/Z5kYBervgrP4Ep0+zd5xXMF2A/oWtiOcSfAWtWTyq3C0bjEJ/O NbeOoMk4StD6T5ioLDe9as3xvpCEFVV2xtTKPhXIyTzFjfZekrBegCMEVMGCm+7CY3VNAA qZDavjiz+hwwWHcLIvdDez7RsS1yNyk= 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-out1.suse.de (Postfix) with ESMTPS id 4591B22053; Tue, 13 Dec 2022 08:51:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1670921488; 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=cJqVpp0rgt2DpLfJteOt1+knopZ57BAnBRXhD56Saew=; b=MfMJRehQtolYF5vDu/F2qedFOWN5WjmU9c57R+GI1JCJbJYbMgJO0bjjf4S1YVNy0qGtIo u672Fjtmqv/Ii8avOlmNsNaT+W4ZkjnojFEgAYgg+bY/BIy2tr2FefoWzPGm0l/yfl6CEJ bn5zrj+XgsAI5VrL7PTa5ET5Aefo6Ok= 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 215B2138EE; Tue, 13 Dec 2022 08:51:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Qu2dBBA9mGN5LAAAMHmgww (envelope-from ); Tue, 13 Dec 2022 08:51:28 +0000 Date: Tue, 13 Dec 2022 09:51:27 +0100 From: Michal Hocko To: "Huang, Ying" Cc: Mina Almasry , Tejun Heo , Zefan Li , Johannes Weiner , Jonathan Corbet , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Yang Shi , Yosry Ahmed , weixugc@google.com, 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 Message-ID: References: <20221202223533.1785418-1-almasrymina@google.com> <87k02volwe.fsf@yhuang6-desk2.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k02volwe.fsf@yhuang6-desk2.ccr.corp.intel.com> X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A254B1C000D X-Rspam-User: X-Stat-Signature: cfm4wxqg67msob9izgnrst4udxo9bi9g X-HE-Tag: 1670921489-862794 X-HE-Meta: U2FsdGVkX19jS6XGJaw/tIV62BiElY1DVST23eJAzf7IQ8tf+3EDcQhsbPzu4MQ4ot+hIbs2p5uR8wd5OIekHm8txfxU6C6NQisAvL4NZFyEOsPmt3TnNlwqhccr9crgy8oCNpJ5TD/Ml7s9atKKlDTRFjWU57E/LcZlDKsWtfV7QBq8SYz7ogp61JcU+4uwxQTz7srC48eNfXLwLujboK3aCosA+Qh1woXdN7U8YSqGTKRxszwUbXZzRv9KBYfxH/ufKws+TEbLEFNHDTc+96lTOfxf9Yd7X2wsy2uB16jBds+wVhzg84s7tGE6etwBXDySl6IjUSiEQwA2EaywiIwxmxOmihJhxEeJQ2JOBmXkJnJcLDHxTVN2hp4L+CQmjqJmDsTPFUibAAoFt7W+NyLHOHpkGu7Msoj0wjpGCbpYnc4+E4DBOTwl3CGiRCA6lR9+GwRtkhWga88xTMJYsRs4Ec5OZ/JNO/O0LoFfoePKLaTCbFcNuB4n4tG22yMznSuoCJc8vJIWx/X/8YjUULsOLFxtMAPNSx/85P86PXCn0ooMV5T8XklGZhlGX1QcxpHJaESt8/zSIBT0lVdLg4sXbnwQ/OU1+qcMkOB6Q/O0bnKC+CYyvdtklsXAjvZ5lhhs5+fvfP9CRYOK7r4oAZVKqZo6CnzsfONJlFMqL25XChErq6tm4OHaplq9F8oTrD6TToyNNzI1wit19V/P5kOcrjWF4qRrv4is6cA43lCfCC2qrKAj/v544afDAl39D7gOPGW3m7Vstqm3nPKRylbtl4nzq0pCkMPD3o9N2F/xfMWbTtpLdJRmbeM4H83q2rlL94hJ7ai1K1lRnuTGXena6a43xPWDS3hacqaPOw5R65E0wRF70Q== 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 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? -- Michal Hocko SUSE Labs