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 6754AC02182 for ; Thu, 23 Jan 2025 03:46:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 01125280004; Wed, 22 Jan 2025 22:46:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EDC61280002; Wed, 22 Jan 2025 22:46:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA345280004; Wed, 22 Jan 2025 22:46:57 -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 B86DC280002 for ; Wed, 22 Jan 2025 22:46:57 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 3A106A0760 for ; Thu, 23 Jan 2025 03:46:57 +0000 (UTC) X-FDA: 83037330474.11.96A23C5 Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) by imf09.hostedemail.com (Postfix) with ESMTP id 5CDA0140007 for ; Thu, 23 Jan 2025 03:46:53 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=QpfjlUFh; spf=pass (imf09.hostedemail.com: domain of ying.huang@linux.alibaba.com designates 115.124.30.113 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=1737604015; 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=VG+1ZI6pqjAQY5R0EBu0W5Afy8dC3H4uZylNEGDHZfo=; b=j6CE/Xk+IpRM19/+M7iJJQ8JNTZxFeEG2E8oFzWz+BH75Fuw3bS4iT5TnN9/onmJbCQ/G5 AfyY7lpUF5GNJY79wrFvYUZBZYrWyBQywmSXfNF+8xqIJ2SHMGBvTnYU760k/QDA6wD5nf 2Ggx/UyMLML6iE402T1uFSr5QKAAPFY= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=QpfjlUFh; spf=pass (imf09.hostedemail.com: domain of ying.huang@linux.alibaba.com designates 115.124.30.113 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=1737604015; a=rsa-sha256; cv=none; b=glEPEWrXPR0LPIcKMZReaaiVydljYQoqf+FWhtcWuV/yeHCjTDxKjS5UkBtJd2zdUlpLER 13FdtinevVQkkFed3iaQM/zrGRGBpkqFoflzeCuD9ju+CkXn1qzrAKu7vOMSQiX3L0ZEQ9 hdX8SLl4S732+0+rW+Ks3unQBj1qmis= DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1737604011; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=VG+1ZI6pqjAQY5R0EBu0W5Afy8dC3H4uZylNEGDHZfo=; b=QpfjlUFhjcz/+owV7IhC+SY72L3fw75nBl3ajxOzvwWZil0CBxNv6C+aQfaJM1KNGBWsoyGEbx8OPXqQrSTBWXOUuycEM5LT8Y31uDAva8VNfNIKu1p4lOgm+zTAYM37UBqOHFkhrX3sUDuXpwnqOGhyTPY2/UP8l48HmGQHoeU= Received: from DESKTOP-5N7EMDA(mailfrom:ying.huang@linux.alibaba.com fp:SMTPD_---0WOAGnVM_1737604009 cluster:ay36) by smtp.aliyun-inc.com; Thu, 23 Jan 2025 11:46:50 +0800 From: "Huang, Ying" To: Gregory Price Cc: linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, nehagholkar@meta.com, abhishekd@meta.com, david@redhat.com, nphamcs@gmail.com, akpm@linux-foundation.org, hannes@cmpxchg.org, kbusch@meta.com, feng.tang@intel.com, donettom@linux.ibm.com Subject: Re: [RFC v3 PATCH 0/5] Promotion of Unmapped Page Cache Folios. In-Reply-To: (Gregory Price's message of "Wed, 22 Jan 2025 11:48:49 -0500") References: <20250107000346.1338481-1-gourry@gourry.net> <87v7u7gkuk.fsf@DESKTOP-5N7EMDA> Date: Thu, 23 Jan 2025 11:46:49 +0800 Message-ID: <87y0z2jiom.fsf@DESKTOP-5N7EMDA> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Rspamd-Queue-Id: 5CDA0140007 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: rucf6crax879wshf3d6jsoddr99giwhd X-HE-Tag: 1737604013-36364 X-HE-Meta: U2FsdGVkX19rFxL4bPAjkhG1HcAQnxJhzHhz92ZPVbNz4jS+JRLxRgXIuef1s7sOfxA6G+ehgtWTveP2QrA4RUFVoFaYUn+C7mBPDJolSQsk9DHI8eTC87qNuwA97qCvSjs9II8N2A4iTiC7q0psr1CBn1mg7YbJU3HhLIRub1gUT00A1zmRhnf1DKP2WPS7T8m1mhersPD4Ydmcqpt6oPeMYiOPMq2GOSx+4+Vad53TTAfTFqdNAynts9MLZKQDLy+a6cGHwVhX2R1qGnEfvpelI8jjzmjwUPlLmYJSu6KR2As+Vw/yLBjOTA/lK1Kj96yb28wmLNgVAmUULviEj+FXpocpSEDFTY5/WnXyP434z/B7Pmr8hbATCuTtILqRXc3765wCHUdSGqipzVLNSOAc5Cvb6Xe70ClJ/3hmHpQKm1aAGL93iqpq7BGledjj4rUYDS14prnPBuD8kpWvkR45EyYtxLiXWvmzbPdGvqb2YDOu9F5VIWHY6K0gxMl21HPBML1QSGLxWl6agnKsYOk/CpRBmSlJrPyDZrZWnVkeLoyxgsG67gpPL937nHOzX27wJB3saKSG4v91xO8WDoKcwx04pH52nkinhWAMSscypx5mxtV1GhQHBrZG2QNaRCqDp7ptvj8ZDu4bGqM/98CmQ22vdmvN98lRpWHxu2cVg/+/nlJ8HnSX9hE6vueA6vxFxOkD+wtTJT51KJUUkyVDr5VRWJ1npRgM7xY5dfUJrJgznoPnQ80dsybBuGWXOm9WI3IIL5Hllla/wl1Av29ZLEpkHlCtgV5ePTmyhAHytqVORbTfm+VwggzlcK2EARKQKFPV3z8acLdj7wa+cOjy+I0ZoBeTd3FwI7pLHXmH7lSzyqTsfN1+HGtc+qeGdbJo13K5mlbN1ydXgvAjCTFgKubQe1T7B4HyHLo2dxWKZNiK2VZRmFXu/S14obsSjN53Hv/rzORt7oUzn7H UlOgX0PW Af/EJGuDPa1+Mt1yY3FxXlxixVz68a59wV7jc/8azLVUCHYBllS3prW4o3+CyOjcAUy8Sy6yPVGXh/zOkHxRdp1m2IwkR54r6BDuvqbBekIV9XI14dex+jBZtcA1ygAlI86MKBENxLAvLRst/e0uTceSsWi7MjniXyrAfflQom73nJSv7fATiMUmbp7FTbqfFeqaNMkz3FYwNApGcmRPvKGk+Pp4VVsBhjCG8+uFF9ngZFtTdB8cjYOS5uIfcdH5ero1Q5AX9QfLtWHU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, 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 Wed, Jan 22, 2025 at 07:16:03PM +0800, Huang, Ying wrote: >> Hi, Gregory, >> > Test process: >> > In each test, we do a linear read of a 128GB file into a buffer >> > in a loop. >> >> IMHO, the linear reading isn't a very good test case for promotion. You >> cannot test the hot-page selection algorithm. I think that it's better >> to use something like normal accessing pattern. IIRC, it is available >> in fio test suite. >> > > Oh yes, I don't plan to drop RFC until I can get a real workload and > probably fio running under this. This patch set is varying priority for > me at the moment so the versions will take some time. My goal is to > have something a bit more solid by LSF/MM, but not before. No problem. >> > 1) file allocated in DRAM with mechanisms off >> > 2) file allocated in DRAM with balancing on but promotion off >> > 3) file allocated in DRAM with balancing and promotion on >> > (promotion check is negative because all pages are top tier) >> > 4) file allocated in CXL with mechanisms off >> > 5) file allocated in CXL with mechanisms on >> > >> > | 1 | 2 | 3 | 4 | 5 | >> > | DRAM Base | Promo On | TopTier Chk | CXL Base | Post-Promotion | >> > | 7.5804 | 7.7586 | 7.9726 | 9.75 | 7.8941 | >> >> For 3, we can check whether the folio is in top-tier as the first step. >> Will that introduce measurable overhead? >> > > That is basically what 2 vs 3 is doing. > > Test 2 shows overhead of TPP on + pagecache promo off > Test 3 shows overhead of TPP+Promo on, but all the memory is on top tier > > This shows the check as to whether the folio is in the top tier is > actually somewhat expensive (~5% compared to baseline, ~2.7% compared to > TPP-on Promo-off). This is unexpected. Can we try to optimize it? For example, via using a nodemask? node_is_toptier() is used in the mapped pages promotion too (1 vs. 2 above). I guess that the optimization can reduce the overhead there with measurable difference too. > The goal of this linear, simple test is to isolate test behavior from > the overhead - that makes it easy to test each individual variable (TPP, > promo, top tier, etc) and see relative overheads. > > This basically gives us a reasonable floor/ceiling of expected overhead. > If we see something wildly different than this during something like FIO > or a real workload, then we'll know we missed something. > >> > >> > This could be further limited by limiting the promotion rate via the >> > existing knob, or by implementing a new knob detached from the existing >> > promotion rate. There are merits to both approach. >> >> Have you tested with the existing knob? Whether does it help? >> > > Not yet, this fell off my priority list before I could do additional > testing. I will add that to my backlog. No problem. --- Best Regards, Huang, Ying