From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.177.127.206 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795087482; b=o+7/NQrgVKRt2VIsCmp1pMKP4PlYy38uVXdFcpCaSmMWGzzcM0iAb2itf6Nb6mIL/W7S hAvXi5ivKILm1GHIXcy24r300gwTr6iRTDItUK8iqWskC5GlTEmMkcswGoWONkkarwnXq hKLBcw9l5eAtDgBoSrSxhchRd1Ai5T7jzp/+2XCYZ/8odoUTQ+d/QMsrh6PTyYuznB6Xq 1zzvwn/RLhURMUc3w/SJZ1PLG9pPO1CqYiJ7BOUg1RjdKLKKlYM5luW/ueYhPpYweowlf Kk+dZyrSPbh2IyY6n1I3p98CAwxscBfhyal03oKk5wi9PE48LRv1KQpaqPi/jvR191Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795087482; h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Envelope-From; bh=9Y4HSKGmKLqBmv82uN8Zw1yJpfCCeKgGfjpKz1LLlzs=; b=Bp4JYe/q3iMU/goXDuNNJiQxOju9/C7hgjTuSecXXZFIpjK4LuBfKIZiNqma2OBta6Op knVZzGvJikiIEXy92fjo3JJYxjrF7CXG4S6wUr8++0abS6D03kkRttPPKl4M9CRIiD8Hg 2W6pwFQZQKJiKYx8KKQ0vz+IXzWJN/fLCZB86qySQb2wFcYmaYejscscKHniTtyFEUt2g iqjP1JqfDvRC4kNLd4mNOxsSnVVzDFdNQR9s3LedqYs0FcwSwib5AgGGjWStLOTWuMgO1 T+HXq0rA7uhbY+vjvbDzUQC17Cy84w/uqzCLHuJ73sBZcDt5t7jhoAzNv40eTqx1gqw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=tychen.cc; spf=pass smtp.mailfrom=tychen.cc; dkim=pass header.d=tychen.cc header.i=@tychen.cc header.a=rsa-sha256 header.s=spacemail header.b=QFssQDBU; arc=none smtp.remote-ip=198.177.127.206 Received: from out-utut-a206.jellyfish.systems (out-utut-a206.jellyfish.systems [198.177.127.206]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF7F9606A325 for ; Thu, 19 Nov 2026 11:24:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DF7F9606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=tychen.cc Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tychen.cc Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tychen.cc header.i=@tychen.cc header.a=rsa-sha256 header.s=spacemail header.b=QFssQDBU Received: from fedora (ec2-52-197-241-54.ap-northeast-1.compute.amazonaws.com [52.197.241.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.spacemail.com (Postfix) with ESMTPSA id 4jVbhS4WPLz8sWT; Thu, 19 Nov 2026 11:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tychen.cc; s=spacemail; t=1795087465; bh=9Y4HSKGmKLqBmv82uN8Zw1yJpfCCeKgGfjpKz1LLlzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QFssQDBU1bWgh5y1TGsTPlJBzh222++oczH4cleFn81Ik9KK1tcsybvy2u8PoG98e 9E0oFppVnJX46zo5smPRv7Y69CZiOxAsRIXtIqO+/mvKfUZJqP0HCPXqh2FYWHpkyP j+7rU7BUV3pZQ+I+zOmYB05/vr5sEUJcKPu8NP0kDSEcazUaz6fCkNU92yM9o7mbYE DJaYV3Kj5jLcKP4kHLAe7ycckEVMZuF0tIYhOIT0BV7idayvyclagc6LFG8IIp6vrv mkzLXPapiNWtPHXOMz7nMy3835yv0C0JPXl1npzATBg3tix7i63IkvltjWJXkERgGv wWfrRY4Li7D9Q== From: Tianyi Chen To: Kairui Song Cc: linux-mm@kvack.org, Andrew Morton , Johannes Weiner , Muchun Song , Qi Zheng , Ying Huang , Chris Li , Baoquan He , Nico Pache , Usama Arif , Michal Hocko , Roman Gushchin , Shakeel Butt , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Vlastimil Babka , Suren Baghdasaryan , Nhat Pham , Youngjun Park , Zi Yan , Gregory Price , "Matthew Wilcox (Oracle)" , Baolin Wang , Ryan Roberts , Dev Jain , Lance Yang , Hugh Dickins , SJ Park , David Rientjes , Yu Zhao , Vernon Yang , Zicheng Wang , Chen Ridong , Tal Zussman , Kairui Song , Xiang Liu , Ehab Ababneh , Zhao Zhenzhuo , Lian Wang , Joanne Koong , Kunwu Chan , Hui Zhu , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, damon@lists.linux.dev, linux-doc@vger.kernel.org, Maxim Muzafarov , hi@tychen.cc Subject: Re: [PATCH v5 00/17] mm/mglru: frequency guided promotion (MGLRU-FG) Date: Thu, 19 Nov 2026 20:23:56 +0900 Message-ID: <20261119112357.275352-1-hi@tychen.cc> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261119-mglru-fg-v5-0-9eee2fe97a2d@tencent.com> References: <20261119-mglru-fg-v5-0-9eee2fe97a2d@tencent.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Envelope-From: hi@tychen.cc On Thu, Nov 19, 2026 at 05:03:32AM +0800, Kairui Song wrote: > That's because MGLRU deliberately disables hotness tracking for > MADV_RANDOM areas while CLRU still has refault distance. [...] I ran the OpenSearch k-NN test from the RFC thread [1] on this series. Its .vec/.vex index files are mapped with MADV_RANDOM, so from the paragraph above I expected no change. With FG the gap is gone in this test. Setup: 25fee5b1762b with and without all 17 patches (they applied cleanly), the same .config, and a fresh 4 vCPU / 5 GiB KVM guest per kernel. OpenSearch and a one-pass 96 MiB mmap scan share a 1 GiB memcg with no swap. 5 seeds, lru_gen enabled=7 vs 0. The script is unchanged from [1]. Medians over the 5 seeds, last 1,000 queries after the scan: p99 (ms) memcg file refaults .vec resident (MiB) base, MGLRU 66.18 144,387 99.98 base, lru_gen=0 2.09 0 117.19 FG, MGLRU 2.16 0 117.19 FG, lru_gen=0 2.12 0 117.19 Right after the scan, base MGLRU had already dropped .vec from 117.2 MiB to 54-71 MiB (median 66.3) in all 5 runs. FG kept the full 117.2 MiB in all 5. All 5 seeds go the same way, and classic LRU is the same on both kernels. This is one synthetic setup and I tested the series as a whole, so I can't say which patch makes the difference. [1] https://lore.kernel.org/linux-mm/20261119082441.196139-1-hi@tychen.cc/ Thanks, Tianyi Assisted-by: LLM