From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C076B56E04A; Thu, 15 Oct 2026 18:15:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792088155; cv=none; b=Kf3vBSqIsMf6gMpGlYrDDCev/gQBdR+3ncH95mjDiFNaa8yGPFYuw++2PwSN2U2cImMk24Z7MOcZLgplkSjwwG/AdUhiEXwh4R2CUozXOIJByxSVEoofh0QnCYKMJIBwF8D4SSnr6PHh7myoNgmtk5laPdmERsmFriXWp0z0X1s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792088155; c=relaxed/simple; bh=s1/G/exW7I9C8J1Zs0aDe5W6D8qQyUMskv8ZL4vemXA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aUTX3Y4MKcgB4WiM6SUjg/ekg1PrbSBDiMc0Z9o8EF5hq+wRNBXOoClI02Gumotw348lSIa/jA2n3m9W8P09kFoMuuaaKcThRskQj9D+hVeW9f0630r/pTvl2EYVCBE3D+yadrFaUltAI2P7RJPkdzkOi0elvW7KfgnJlRc7mL0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RPK2LnRz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RPK2LnRz" Received: by smtp.kernel.org (Postfix) with ESMTPS id 33C02C2BCF4; Thu, 15 Oct 2026 18:15:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1792088155; bh=s1/G/exW7I9C8J1Zs0aDe5W6D8qQyUMskv8ZL4vemXA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=RPK2LnRzKNHqSDcsJs62+H7Q0GFWNOsx4JRA5AmCvcjFb9mCN1tkcbwxPRFKroi9p KGY8XuB6hWGj5c9Xxt9uynobCYDCrZwJikOK70ttOznJ8vQXEmVYQunMSBcJP43lQA F25p4YOqjIq1XnDiPGkfwSUeT74ET2WMa9QyClHBhoz+XkiVCynG2YdnncuugWxtSC 5RX0iJtwOKgRsF8YasB+pLKYj+pQ74Gdgs34vE7TKeJ+PmSiQiisIYIvi72pM/4JH1 /trL0f7DgVUYFNxKvAZ3rSYWh1M279PLNYXXyPmwJSYWB7dD1jrxwjFmf7xfmuCrJE qnrHxXwpLaiZw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 106D4CC6B38; Thu, 15 Oct 2026 18:15:55 +0000 (UTC) From: Kairui Song via B4 Relay Date: Fri, 16 Oct 2026 02:15:50 +0800 Subject: [PATCH v4 01/17] mm/memcontrol: allow update of LRU statistic without holding LRU lock 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="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261016-mglru-fg-v4-1-2106750c0bfa@tencent.com> References: <20261016-mglru-fg-v4-0-2106750c0bfa@tencent.com> In-Reply-To: <20261016-mglru-fg-v4-0-2106750c0bfa@tencent.com> To: linux-mm@kvack.org, "Liam R. Howlett" , SJ Park Cc: 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 , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Vlastimil Babka , Suren Baghdasaryan , Kemeng Shi , Nhat Pham , Youngjun Park , Zi Yan , Gregory Price , "Matthew Wilcox (Oracle)" , Baolin Wang , Ryan Roberts , Dev Jain , Lance Yang , Hugh Dickins , David Rientjes , Yu Zhao , Vernon Yang , Zicheng Wang , Chen Ridong , Tal Zussman , Kairui Song , Xiang Liu , Ehab Ababneh , zhaozhengzhuo , Lian Wang , Kunwu Chan , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, damon@lists.linux.dev, Kairui Song X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1792088152; l=1134; i=kasong@tencent.com; s=kasong-sign-tencent; h=from:subject:message-id; bh=WaY0YQ32toU3iWe0KThIrrS8OVU12NSfLZ8Lil6VesU=; b=V+guvWhaQbqmzqqbc8zI+LRwI/lXcAEz81sU0OsErjMX8doqUKgRBPVmBCb7/aGiM2I6H04mV ADgUv8gHB7QBgzvvNxLatOtSNL3y1wTHQ7nwuvaL7DBiAQGloBrYEdi X-Developer-Key: i=kasong@tencent.com; a=ed25519; pk=kCdoBuwrYph+KrkJnrr7Sm1pwwhGDdZKcKrqiK8Y1mI= X-Endpoint-Received: by B4 Relay for kasong@tencent.com/kasong-sign-tencent with auth_id=562 X-Original-From: Kairui Song Reply-To: kasong@tencent.com From: Kairui Song To enable moving file pages in folio_mark_accessed directly and lazily for MGLRU, allow updating the LRU statistic atomically without holding a lock. It may cause temporary counter underflow, which should be fine as we still follow final consistency of the counter, and it only serves as a estimated metrics, a little inaccuracy has no visible effect. Signed-off-by: Kairui Song --- include/linux/mm_inline.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index ab69b9930893..597f013c8e04 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h @@ -47,11 +47,10 @@ static __always_inline void __update_lru_size(struct lruvec *lruvec, { struct pglist_data *pgdat = lruvec_pgdat(lruvec); - lockdep_assert_held(&lruvec->lru_lock); WARN_ON_ONCE(nr_pages != (int)nr_pages); mod_lruvec_state(lruvec, NR_LRU_BASE + lru, nr_pages); - __mod_zone_page_state(&pgdat->node_zones[zid], + mod_zone_page_state(&pgdat->node_zones[zid], NR_ZONE_LRU_BASE + lru, nr_pages); } -- 2.56.0