@@ -11,6 +11,10 @@ static inline bool arch_supports_page_access_count(void)
#endif
#ifdef CONFIG_LRU_GEN
+bool __try_to_inc_max_seq(struct lruvec *lruvec,
+ unsigned long max_seq, int scan_priority,
+ bool can_swap, bool force_scan);
+
#ifndef arch_get_lru_gen_seq
static inline unsigned long arch_get_lru_gen_seq(struct lruvec *lruvec, struct folio *folio)
{
@@ -19,8 +23,16 @@ static inline unsigned long arch_get_lru_gen_seq(struct lruvec *lruvec, struct f
return lruvec->lrugen.min_seq[type];
}
#endif
-#endif /* CONFIG_LRU_GEN */
+#ifndef arch_try_to_inc_max_seq
+static inline bool arch_try_to_inc_max_seq(struct lruvec *lruvec, unsigned long max_seq,
+ int scan_priority, bool can_swap, bool force_scan)
+{
+ return __try_to_inc_max_seq(lruvec, max_seq, scan_priority, can_swap, force_scan);
+}
+#endif
+
+#endif /* CONFIG_LRU_GEN */
#endif
@@ -4536,7 +4536,13 @@ bool __try_to_inc_max_seq(struct lruvec *lruvec,
static bool try_to_inc_max_seq(struct lruvec *lruvec, unsigned long max_seq,
int scan_priority, bool can_swap, bool force_scan)
{
- return __try_to_inc_max_seq(lruvec, max_seq, scan_priority, can_swap, force_scan);
+ if (arch_supports_page_access_count())
+ return arch_try_to_inc_max_seq(lruvec, max_seq,
+ scan_priority, can_swap,
+ force_scan);
+ else
+ return __try_to_inc_max_seq(lruvec, max_seq,
+ scan_priority, can_swap, force_scan);
}
#endif
Some architectures can handle different methods for determining page access count. We may want to do architecture-specific tasks reclassifying generation temperature etc during aging for such architecture. Add an arch hook to support that. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> --- include/linux/page_aging.h | 14 +++++++++++++- mm/vmscan.c | 8 +++++++- 2 files changed, 20 insertions(+), 2 deletions(-)