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 11517E77188 for ; Sun, 22 Dec 2024 07:10:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 804CD6B0083; Sun, 22 Dec 2024 02:10:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B47B6B0088; Sun, 22 Dec 2024 02:10:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 67C646B0089; Sun, 22 Dec 2024 02:10:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 47C926B0083 for ; Sun, 22 Dec 2024 02:10:01 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id F069412044C for ; Sun, 22 Dec 2024 07:10:00 +0000 (UTC) X-FDA: 82921719510.22.C86BA93 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by imf08.hostedemail.com (Postfix) with ESMTP id C4C7416000F for ; Sun, 22 Dec 2024 07:09:33 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=JYIhgTg7; spf=pass (imf08.hostedemail.com: domain of ying.huang@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=ying.huang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734851361; 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=XaHSs+iC1uPL/bneB0PzF/WFyNMoaXbt17kqkRdp75k=; b=CiUJmOJrKU4UyflCgb7g9PZj4ikXAdlyDY0G3FzGDq/nqonWUBJOuB7Pnzrh1Pq9tLVkBJ Uh0K1Cn9iDR50sDNOhyWjIMf1hcX/f3gnD1B3rBN8re8HdYzWwEj7OoCIb+E6uhfLER/9F VPPzv5Ph0e7acFBfIpplWE+xBgvGatk= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=JYIhgTg7; spf=pass (imf08.hostedemail.com: domain of ying.huang@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=ying.huang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734851361; a=rsa-sha256; cv=none; b=vTht5w6g12m4G/eeUo7oB0D9Mwok2rLFfaGU/97KQSxf1MQMqGDuvn5LA7VirkHbbkhuD2 7LeNRNl75OkPFm7LOjj7Cah8R6SSA9WJTc1XThkWxUds1rKAk3UD7QCkkvtTSuyo/pSBLN fnIF1h6otYo7HwEmRcsDkprTDkKm89o= DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1734851393; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=XaHSs+iC1uPL/bneB0PzF/WFyNMoaXbt17kqkRdp75k=; b=JYIhgTg7vXiFlNWEFLz0iHzAV8ArGtALA9MU9xqmnYjzDn5tWHejWPSuWLBgiPdpJY1n0RmqYRXu5vuOfzZdYi/NsPSfPY8xClKmgMqkVlsScf6OpHrDps31exyUZjEfUNGQAUgNrCwT78ToypaT7PCv0TyWKv2rQPzikv40Tsw= Received: from DESKTOP-5N7EMDA(mailfrom:ying.huang@linux.alibaba.com fp:SMTPD_---0WLyCB5d_1734851384 cluster:ay36) by smtp.aliyun-inc.com; Sun, 22 Dec 2024 15:09:52 +0800 From: "Huang, Ying" To: Gregory Price Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, nehagholkar@meta.com, abhishekd@meta.com, kernel-team@meta.com, david@redhat.com, nphamcs@gmail.com, akpm@linux-foundation.org, hannes@cmpxchg.org, kbusch@meta.com Subject: Re: [RFC v2 PATCH 0/5] Promotion of Unmapped Page Cache Folios. In-Reply-To: (Gregory Price's message of "Sat, 21 Dec 2024 09:48:57 -0500") References: <20241210213744.2968-1-gourry@gourry.net> <87o715r4vn.fsf@DESKTOP-5N7EMDA> Date: Sun, 22 Dec 2024 15:09:44 +0800 Message-ID: <87wmfsi47b.fsf@DESKTOP-5N7EMDA> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: C4C7416000F X-Rspam-User: X-Stat-Signature: bzhs94wqhobb9s891zdpxkfphhhtwgrb X-HE-Tag: 1734851373-227529 X-HE-Meta: U2FsdGVkX19A2ki+82Gf1an76JIbkCzX2mCzmgENJABcOoq+nx1q8CK2EuwUPRnJSLVr2ttYRUt0xRqIx2zRXUbrU3n1H9RSK8rynQS0sRTJCCkPPYua2DA3ZC4BAsfDfZxy3flpucWyULtTVkydIF6Fv3gB3FapkybG2gyKUB3PsxZ3yibYcRO9/+fktxwN9z3/hF82Zg4IgaSKVJwqF8zVzh9yQMrB8+Y/9HpUdsywsh1iH0jEslS+JxTQ6AG/iKUUWMUUfEhVQCBjypCXiHPTEFEu7YOcPS8w1pW6aMWraT4KwXeGU71fQlIq+zX+6bxLnvac+80nrRdA2ZwShkczVzl+HwdTgVS/THROuNOUrEVr/y93ZFtYtXIVuhuP6MgdoW4AshLOGbJ5bXf6K6zwexgcWw6BSOmvnF+EsOprAlEUrsW4aXWCPIKu3UR4Z1XbYkjM/31B++cRROjlMvINypLb8rILTNGpKv6mvQbwf5/tDJLOmdP0QEhYa0ZbnauzxYhdWM+6Z5blF6EF6ZpQr5GO84ABW4o6TLHOO+AlkRds/uXupzOCSU+iBOdy4/auEO6NO/DBSXFA+Bdk5LX0wGcvvre3wnD1TKg4pI826cx9RlPpk3YsJZxtlZNKR8JDlUlHMjjxYT06FOhZrnfEEwGF/0WRe2GVQiOJknK1PEMy+ne+NI3WLOaLEMK0id1WF1XUCO7LF7S9ShoWZA19bDNZHVqZ4DKjnQGokwyfkKFta0Y6CHFfqrn6OzJ2Eadme+XQDBjJE0vxU3zIC2qGbgQdh1yZes2FR5gcsr5V2B+ns+pMum6LgPwdBBwGs6eOSDjyrT1l8Bi5DlaVRN0hpL6mLu+InYunecAIJaJRlSoQUpk5KmGEOCDc+a8TIBBLRHsz3pwNbVQt9N9aQjtXVIubQrRMKRJYr5NvQxmh9dR2hvJpL9PJ4oXk9ky+NoGe973ZmDUKAaw2Wx2 8WWYL040 Y/D37crj0MzZ7ODkf1I/mIcrP1iozQE2I4sUqkHpFA1sSJ85r1ljNqcfEomLehJcumDSMtODwGpHK+dfiJAXG5w+uHrSQE3xqzJP/SQvjh/lzZqQ/qcTcKKu57h1T4bSIpFJftlz1utx1+lq00owdpJr5jn63hdeMUiC2kP2PA+ff4P2vlSlFjBakorBzQw+rV27aSOW/LAYdtjNyOFMsnQR01q4MNypo1bG6HQYeOsnyW/Rj8eTDsBUi40MPOGKTVkl2ypHc+QEfTK0= X-Bogosity: Ham, tests=bogofilter, spamicity=0.003235, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Gregory Price writes: > On Sat, Dec 21, 2024 at 01:18:04PM +0800, Huang, Ying wrote: >> Gregory Price writes: >> >> > >> > Single-reader DRAM: ~16.0-16.4s >> > Single-reader CXL (after demotion): ~16.8-17s >> >> The difference is trivial. This makes me thought that why we need this >> patchset? >> > > That's 3-6% performance in this contrived case. This is small too. > We're working to testing a real workload we know suffers from this > problem as it is long-running. Should be early in the new year hopefully. Good! To demonstrate the max possible performance gain. We can use a pure file read/write benchmark such as fio, run in on pure DRAM and pure CXL. Then the difference is the max possible performance gain we can get. >> > Next we turned promotion on with only a single reader running. >> > >> > Before promotions: >> > Node 0 MemFree: 636478112 kB >> > Node 0 FilePages: 59009156 kB >> > Node 1 MemFree: 250336004 kB >> > Node 1 FilePages: 14979628 kB >> >> Why are there some many file pages on node 1 even if there're a lot of >> free pages on node 0? You moved some file pages from node 0 to node 1? >> > > This was explicit and explained in the test notes: > > First we ran with promotion disabled to show consistent overhead as > a result of forcing a file out to CXL memory. We first ran a single > reader to see uncontended performance, launched many readers to force > demotions, then dropped back to a single reader to observe. > > The goal here was to simply demonstrate functionality and stability. Got it. >> > After promotions: >> > Node 0 MemFree: 632267268 kB >> > Node 0 FilePages: 72204968 kB >> > Node 1 MemFree: 262567056 kB >> > Node 1 FilePages: 2918768 kB >> > >> > Single-reader (after_promotion): ~16.5s > > This represents a 2.5-6% speedup depending on the spread. > >> > >> > numa_migrate_prep: 93 - time(3969867917) count(42576860) >> > migrate_misplaced_folio_prepare: 491 - time(3433174319) count(6985523) >> > migrate_misplaced_folio: 1635 - time(11426529980) count(6985523) >> > >> > Thoughts on a good throttling heuristic would be appreciated here. >> >> We do have a throttle mechanism already, for example, you can used >> >> $ echo 100 > /proc/sys/kernel/numa_balancing_promote_rate_limit_MBps >> >> to rate limit the promotion throughput under 100 MB/s for each DRAM >> node. >> > > Can easily piggyback on that, just wasn't sure if overloading it was > an acceptable idea. It's the recommended setup in the original PMEM promotion implementation. Please check commit c959924b0dc5 ("memory tiering: adjust hot threshold automatically"). > Although since that promotion rate limit is also > per-task (as far as I know, will need to read into it a bit more) this > is probably fine. It's not per-task. Please read the code, especially should_numa_migrate_memory(). --- Best Regards, Huang, Ying