From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6260E2F43 for ; Sun, 22 Dec 2024 07:10:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.110 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734851404; cv=none; b=n2+eJQwzBukNVhHe2uAbHLwrA2XYmU4Y6xnH5tCtGTUMi/Bg8kRxONz8YJrxM2GQyFENwsMZZqjQ+oRsM1RGBpUrJj7ahJno23sayLHGb+skGy+utWEUw+t4NDeR3svLXhlmcZT35FkgUkcrEU+thnqJbnGfPVzeMAc2jgSEzAU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734851404; c=relaxed/simple; bh=2ojic6JpBNjBNRx5WxmfEvxvbQvyJlew9wtzptP9GcQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=emlzKYg8KWgVfZx+arHNkKNneIT92gygwCmMzXqCeWqTCn90oa4u87rHRzCzPHV2gxgC5WzODdKaTipK3se6FVbxU+okgHsClLDvG3QiPplgu1lXOkYKx8omJalooz4nbUt6AcY6LG2qJC9Yws2FBs60dbgwnsIvxRF9WGi6kuY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=JYIhgTg7; arc=none smtp.client-ip=115.124.30.110 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="JYIhgTg7" 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ascii 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