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 715953A16A1 for ; Thu, 16 Jul 2026 10:46:38 +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=1784198803; cv=none; b=cvcSkfULywCkfYz+DyZNMyYy5sLbgRiCt7l2gtlvr6ur5dHOhvRegC9WxiURSEjlkHh9VNqaIYxUIVMMHnkzuoTW23SD2UMSF8y1uGN4E1aqvlh7ZFfZnw2NEhBElK712F1oPnx2Yny2XRLm/u/Ozvm5y44jl5lzZ/qwjBfSXiA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784198803; c=relaxed/simple; bh=iMwLNX3sQ7xgJq07MeSsGiNGtmmCDhviOiR/mZDVYwc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KtURIskuP+BWH54jh/RGXbk38u4wNatVFSkpFynjQ+Cc+6tgVY3xRQ6KRYol/nrhB08rtjrjD32kFWkeLYvGYZhsBeZWtMo1YogF8Eg369ExY7OOAliIJdW9p7kAqwB6F2v5XT5sSRh+jRCTG6mHXq6BQKM71BAaET4yk2oILh8= 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=HdT/UraE; 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="HdT/UraE" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1784198790; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=lS+8PcrmibxtgubJdgtpEr1BolM0XkzQscvdMqvtB5k=; b=HdT/UraEGktqBjfhkgW38h/csTyl8Ph6kCTJS7zWgSf9326jrOJyLdm4IFtaS7o6VJ0l/kv/1Oe8aQhD4evPM+h3bP+Dn8Ecvkf/T4wT6aGpJIShGtXIqUYP9w4dIv1KkgjTMOiOrHYat5itDJhNzYeCi6IThYVXq7ncHM2Tl44= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R631e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam011083073210;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0X7EAGcn_1784198788; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0X7EAGcn_1784198788 cluster:ay36) by smtp.aliyun-inc.com; Thu, 16 Jul 2026 18:46:29 +0800 From: Baolin Wang To: akpm@linux-foundation.org, david@kernel.org, ljs@kernel.org, hannes@cmpxchg.org Cc: riel@surriel.com, liam@infradead.org, vbabka@kernel.org, harry@kernel.org, jannh@google.com, lance.yang@linux.dev, kasong@tencent.com, qi.zheng@linux.dev, shakeel.butt@linux.dev, baohua@kernel.org, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, mhocko@kernel.org, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/2] promote mapped executable folios after first usage for MGLRU Date: Thu, 16 Jul 2026 18:46:17 +0800 Message-ID: X-Mailer: git-send-email 2.43.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Now MGLRU's protection of mapped executable file folios is less reliable. Follow the classical LRU's logic, promoting mapped executable file folios after their first usage to give executable code a better chance to stay in memory and improve workload performance (See patch 2 for more details). Changes from v1: - Add a new patch to clean up vma flags as preparation. - Add a new helper to check exec file folios (per Kaisui). - Promote exec file folios in lru_gen_set_refs (Per Sashiko). Baolin Wang (2): mm: vmscan: convert folio_referenced() to use vma_flags_t mm: mglru: promote mapped executable folios after first usage include/linux/mm_inline.h | 6 +++++ include/linux/rmap.h | 7 +++--- mm/rmap.c | 19 +++++++++------ mm/vmscan.c | 51 +++++++++++++++++++++++---------------- 4 files changed, 50 insertions(+), 33 deletions(-) -- 2.47.3