From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-111.freemail.mail.aliyun.com (out30-111.freemail.mail.aliyun.com [115.124.30.111]) (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 121FC3F413D for ; Mon, 20 Jul 2026 11:12:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.111 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784545937; cv=none; b=sLTp1lYsoWuvWECWRrgnpZkoSHL9BGGePaGJn65UX6LlPaSOneLA1Gsu8pSGYHv8He4c4Ftjbn9fG4Il4GsCm1HrMG+9cKRZAE8/fckw+NZ2OQ5nox1gExJV+wmhWkOvsXEsUPcFvaDqCIZst8/dqOWpd1FXVyeYMp0Ot05u/GA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784545937; c=relaxed/simple; bh=3TzDdliTUQpb3/9VxvEFKW2nDs42i2KJBvLaoQCnlYo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DWaYgRkfgFzbwI8xGTcvAaNWSLABGtNc/rVhIThhbJDOYBrRq0kh1lVB8H2Ldevl1B9oAidHJqfZvnLrMQmNgVCjkTOYD9HMrrvQUp79w5jmV1nAdFOTvNl+PwwrjLT0/cFamjbxvwjU7mMe4xhkxhRNJfem+8KPwFaLr6L8Mx4= 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=c1Qq1rME; arc=none smtp.client-ip=115.124.30.111 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="c1Qq1rME" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1784545931; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=OFM0nRJoZuBfdWYZNC4phzSZOwI8EnxnT+H9jcsSDNE=; b=c1Qq1rMEd10vohr4/PTgTRGqNEesFMCi1p/+SWCMF4bHw1asPO0d2YLqSWeDPPiLNUY6XgUeutnZGFR8PCTV0nWlJsldTsxBEBKTiZnF25+EB4ekkqUxVetRze1NZQXxzqW9aDOukMKV43da0zulnysfKl2zqybOpS9NnQBjg24= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R241e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033032089153;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0X7TBAFM_1784545928; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0X7TBAFM_1784545928 cluster:ay36) by smtp.aliyun-inc.com; Mon, 20 Jul 2026 19:12:09 +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 v4 0/3] promote mapped executable folios after first usage for MGLRU Date: Mon, 20 Jul 2026 19:11:59 +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 v3: https://lore.kernel.org/all/cover.1784268206.git.baolin.wang@linux.alibaba.com/ - Collect tags from Johannes, Axel, Barry and Kairui. Thanks. - Split the helper addition out into a separate patch (per Johannes). - Set PG_workingset before promoting in lru_gen_set_refs() (per Kairui). - Some code cleanups (per Kairui). Changes from v2: https://lore.kernel.org/all/cover.1784197559.git.baolin.wang@linux.alibaba.com/ - Add acked tag from David. Thanks. - Rename the exec-file-folio helper and move it into vmscan.c (per David). Changes from v1: https://lore.kernel.org/all/4b921ed528c483e13c9e22d1ae44ba58b4a15b0b.1784096432.git.baolin.wang@linux.alibaba.com/ - 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 (3): mm: vmscan: convert folio_referenced() to use vma_flags_t mm: vmscan: add a helper to identify file-backed executable folios mm: mglru: promote mapped executable folios after first usage include/linux/rmap.h | 7 +++-- mm/rmap.c | 19 +++++++------ mm/vmscan.c | 63 ++++++++++++++++++++++++++++---------------- 3 files changed, 54 insertions(+), 35 deletions(-) -- 2.47.3