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 9355CECE58A for ; Tue, 10 Sep 2024 16:31:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 246688D008E; Tue, 10 Sep 2024 12:31:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F6B38D0002; Tue, 10 Sep 2024 12:31:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 071028D008E; Tue, 10 Sep 2024 12:31:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id D9F818D0002 for ; Tue, 10 Sep 2024 12:31:24 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 961E5C084D for ; Tue, 10 Sep 2024 16:31:24 +0000 (UTC) X-FDA: 82549368888.01.B3B2D05 Received: from buffalo.tulip.relay.mailchannels.net (buffalo.tulip.relay.mailchannels.net [23.83.218.24]) by imf23.hostedemail.com (Postfix) with ESMTP id 1234F140020 for ; Tue, 10 Sep 2024 16:31:21 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=stgolabs.net header.s=dreamhost header.b=eJreuFlQ; spf=pass (imf23.hostedemail.com: domain of dave@stgolabs.net designates 23.83.218.24 as permitted sender) smtp.mailfrom=dave@stgolabs.net; dmarc=none; arc=pass ("mailchannels.net:s=arc-2022:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725985830; 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=M21sw4QFggo2xdZPy1OShYN7xAGP0xryyJe2jxUadRw=; b=sC9ohyzo6/Itq9pA4HjDAIeOpPKOXwBHEBRFT7lkHNxmrM8nxkV7MVbLAPzTUhYgwlE3EB rnGR74NPqcc8sIYHbMgUUB2dP3R5Tout6+oaUTP1HqxJ8CgS1xf6aWY17wOYcK3vLjlB6M CkytqAkL1qc7jgl4jLDO4xbW/jf1mCs= ARC-Authentication-Results: i=2; imf23.hostedemail.com; dkim=pass header.d=stgolabs.net header.s=dreamhost header.b=eJreuFlQ; spf=pass (imf23.hostedemail.com: domain of dave@stgolabs.net designates 23.83.218.24 as permitted sender) smtp.mailfrom=dave@stgolabs.net; dmarc=none; arc=pass ("mailchannels.net:s=arc-2022:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1725985830; a=rsa-sha256; cv=pass; b=HVN3xE8g7C4cr1Ktj96d3RMx2lTfODBCSKgo+nTWNqiiTdmZVd8vpsfUbYqGbm46moMx9o bpm47hR1VwMykSu7iHtJ7g0nWu+7HIbSf+l8CMw+gUEOpeufSby6WMigoWPOysaUok61md saYqQsK303ui/aQXCEBNxbwDC6nu6lg= X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 8CED624B00; Tue, 10 Sep 2024 16:31:19 +0000 (UTC) Received: from pdx1-sub0-mail-a297.dreamhost.com (trex-0.trex.outbound.svc.cluster.local [100.96.218.11]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 10BA224445; Tue, 10 Sep 2024 16:31:19 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1725985879; a=rsa-sha256; cv=none; b=O7RtYpU1hqHEthZTw0w/JwpstOigqfSGb0Q2TQGKyHFV8MbvXimUVBXNggCITqXcFbCVoK DjOW1+jn/+wNSzCjfMiPPrH0W62XlUiTtAGMRFH22mFXLdk+xDuyr6zXrXraJwcq6c8Pfr ayOWn8K1m2jhpspxqWfRPja4/We8CIo3fOo3ow/9Cigl8yQ0YDC9hMnzhp+IWHv2bN2Qoc HdQf3SZ0h056qo2pWRVtiKlg3M/q8uiIM/tvvrVsiunXoRt/fsO9TXf9XsCKn21GehpC6o vORfwZuaR8MYIfemWYINbe8HUerMF0XVNIC1tbp5fqkC0oOUw82xa/HSNkGW7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1725985879; h=from:from:reply-to:subject:subject: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:dkim-signature; bh=M21sw4QFggo2xdZPy1OShYN7xAGP0xryyJe2jxUadRw=; b=g7v6hmlLuC/8skkcDAZ8CLLKsqtHB35U+gJ5HjkNBlsvBkEC97dICjM9K8Acs7Enc8MBWp 9qTNnW9VfxrI/IXZrox+V5MMNhfDX97HqE5vSwrGzsrr5hIhgXsqKS7Y+F2kJlopRj3xXY fGpg2S7fMZ4rfYuz/Y1KlNDNm9kDYOVFXXAWL4fXp4mjB5sf5VJ53QteEh/Q+xjmBgpKPC GHVEo5qY5EhCMOXkw2cYOA7yf7lCvCxs/qBKTYBU7hKgOKDAf7IAXG1e+XP6yD/YLCBLnM qnw8NHZK7FbzEDOn/SBEKNJ+LJE9fSQH7rM7vd/enzhul0UTQX8fVssgAncU6Q== ARC-Authentication-Results: i=1; rspamd-77766c4bb8-bfbzv; auth=pass smtp.auth=dreamhost smtp.mailfrom=dave@stgolabs.net X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dave@stgolabs.net X-MailChannels-Auth-Id: dreamhost X-Occur-Army: 1db628342698e064_1725985879372_1003662781 X-MC-Loop-Signature: 1725985879372:3470074365 X-MC-Ingress-Time: 1725985879372 Received: from pdx1-sub0-mail-a297.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.96.218.11 (trex/7.0.2); Tue, 10 Sep 2024 16:31:19 +0000 Received: from offworld (ip72-199-50-187.sd.sd.cox.net [72.199.50.187]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dave@stgolabs.net) by pdx1-sub0-mail-a297.dreamhost.com (Postfix) with ESMTPSA id 4X38N61tTFz6Y; Tue, 10 Sep 2024 09:31:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stgolabs.net; s=dreamhost; t=1725985878; bh=M21sw4QFggo2xdZPy1OShYN7xAGP0xryyJe2jxUadRw=; h=Date:From:To:Cc:Subject:Content-Type; b=eJreuFlQ7v6fTX30v7AsCanQEyrZM0dAVnwf+u/uAkh/SCFoSaJE59VuyC6mL+rUc pkUdU9W/AbwEktaw4Ckz1CLZY7r03k5+8ei95dVMv/yrdQrBUi+ZbgmZ2LK5sQ8pvV uW2mmzXQW5jgHPRw33HhOf2aezPs2hVoStN0rJ1dI77eNiFIgTYi5ZA2+jEqZ9pka4 mblkRhOzVQVz1+zqAliwVEZtE+fFztpAoMZTegH4R/q/exKRRZ8EcczFszmhHSzLbK DJQHqcMV22eMCC9EU5zpcFrTkpaJETQUe9stqt+SlPwP9nnC4RYIqn/dcj06aHjmoJ 4SgcLhNzuCeXA== Date: Tue, 10 Sep 2024 09:31:15 -0700 From: Davidlohr Bueso To: Michal Hocko Cc: linux-mm@kvack.org, akpm@linux-foundation.org, rientjes@google.com, yosryahmed@google.com, hannes@cmpxchg.org, almasrymina@google.com, roman.gushchin@linux.dev, gthelen@google.com, dseo3@uci.edu, a.manzanares@samsung.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] mm: introduce per-node proactive reclaim interface Message-ID: <20240910163115.cg26kenlejlkmnsp@offworld> Mail-Followup-To: Michal Hocko , linux-mm@kvack.org, akpm@linux-foundation.org, rientjes@google.com, yosryahmed@google.com, hannes@cmpxchg.org, almasrymina@google.com, roman.gushchin@linux.dev, gthelen@google.com, dseo3@uci.edu, a.manzanares@samsung.com, linux-kernel@vger.kernel.org References: <20240904162740.1043168-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 1234F140020 X-Stat-Signature: jfo1z4fihpbwmf1b7grekxz4itrcc4cu X-HE-Tag: 1725985881-684680 X-HE-Meta: U2FsdGVkX1/G2UmtzdLG/Rkht80AeHXrzISKZZNJeaCWMzgrJcZdoVb3vRem/pi60ybgr7W63K/MwQfsQP/5byggBA+YQHOCMghN0Aj2cpEQXXgHB+yGwVMLuKnIqovKAEJQmUlEOTwqAtORKv6ES3rlRmDohVL3QkmZBOI8yolnczen+w2Xp/zAqfdiM6M/7Buw5z6+IimlSmnmhQLdbMBE39gcXcq6Gvr/mCTyJExK9YJXYOEUZhbkaQLG24QKezcNTmzpFaHF3zzLBSJgXPyKPyWASxOliqwMhDj7eu92mDJUsEXqDKswWLIT5ptKD3s9ir6oxWU/nBIjPyIckY92tuYe6L4p7WloUzR8fFIsOeXraDxjxtfTjNo3xazbY2wMSY9cfWgb+HQYL6n7YLJ9nOGcoCq1G95uT8wj5dv55+gJvO5iWAEYJI1f3TQHBHNvcPVmofD+BGmqLa1quURp65LZD+nCTBQ/FttR/nfbJaPYp53yWSgPAaq2wUN1kobunhKmEH0M8TYuXBXtDSkmmAjUpG8bz5ron+Pj/ymUDH+m2bJyhBoihc2Tg+kFzewIJEsjNdFVbG2lJkrFavykdpvuy7aiZIYuJwMJT/JQqwFjHgz6/YZJXZIxg8cXEjGIl6G1zSH5jMKYx/hxkXBbJRFp48pQBtV3DJEdcqFZQTh/mmc7Fbn/uY9u/XQ15geIhcpPSr8XDTrZafMvKl1QK1MuoolDzmtBh8YpmInVxjtvPPeBi9t7bgAfZf3u+MMYBb1dahBLa7heRV48KLw2nVNFJ02NYGIYaq4OArfmY4ctB0IgPEHedjtPHCSutCXBmBjY1vPMDsTQur01gpTbjNqpAdbp5j5W/Y5VQH1PsmAm59Xd89JPFId8lAWWJKm/5P3Zvrf2P/OM6K48CS7t1waYPWhKImTS9oguhAIPIvmuxCdt6rvIvwntEi2ayL7eH2ALGbY6ncbVfcC nNsE8l9P f4puMMpKB02FZDjH4IQoMPxfFHmH7xFH4w2rFfRTg3CuKNKibMcsDocdGQuwvbvk21e7lRSq69uDyuHsVe9aaXDukzGJi/xi5RgQvlUxNvq22iX1/Y5kIojU+CHZcgIcKazB7XyS06HR5qJTW8nsoXH+yW/Mmp1V4N9AyprJTtFEnj+YliUddjTB/sFAUW/lQsxj+6wpaACKS+BlawbCJ+mqgL1F4OAUhfo+/104lD1xPdQQ8S/vn9O/OrHD2yjbW7r8tZGVgJNAltU8aoxljAs7C2Y1HNgqCyCB9O5Xsw4VkScY= 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: List-Subscribe: List-Unsubscribe: On Mon, 09 Sep 2024, Michal Hocko wrote: >On Wed 04-09-24 09:27:40, Davidlohr Bueso wrote: >> 1. Users who do not use memcg can benefit from proactive reclaim. > >It would be great to have some specific examples here. Is there a >specific reason memcg is not used? I know cases of people wanting to use this to free up fast memory without incurring in extra latency spikes before a promotion occurs. I do not have details as to why memcg is not used. I can also see this for virtual machines running on specific nodes, reclaiming "extra" memory based on wss and qos, as well as potential hibernation optimizations. >> 2. Proactive reclaim on top tiers will trigger demotion, for which >> memory is still byte-addressable. Reclaiming on the bottom nodes >> will trigger evicting to swap (the traditional sense of reclaim). >> This follows the semantics of what is today part of the aging process >> on tiered memory, mirroring what every other form of reclaim does >> (reactive and memcg proactive reclaim). Furthermore per-node proactive >> reclaim is not as susceptible to the memcg charging problem mentioned >> above. >> >> 3. Unlike memcg, there should be no surprises of callers expecting >> reclaim but instead got a demotion. Essentially relying on behavior >> of shrink_folio_list() after 6b426d071419 (mm: disable top-tier >> fallback to reclaim on proactive reclaim), without the expectations >> of try_to_free_mem_cgroup_pages(). > >I am not sure I understand. If you demote then you effectively reclaim >because you free up memory on the specific node. Or do I just misread >what you mean? Maybe you meant to say that the overall memory >consumption on all nodes is not affected? Yes, exactly, that is what I meant to say. >Your point 4 and 5 follows up on this so we should better clarify that >before going there.