kernel: bump 5.15 to 5.15.155
[openwrt/openwrt.git] / target / linux / generic / backport-5.15 / 020-v6.1-06-mm-multi-gen-LRU-minimal-implementation.patch
index 1e310ae2111a131127b3d6edeb6b70849777e8b5..14fc73f84de4c158e07ca9d9d7bf1c26058f6bab 100644 (file)
@@ -208,11 +208,9 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  mm/workingset.c                   | 110 ++++-
  8 files changed, 1025 insertions(+), 11 deletions(-)
 
-diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
-index 65320d2b8f60..58aabb1ba020 100644
 --- a/include/linux/mm_inline.h
 +++ b/include/linux/mm_inline.h
-@@ -106,6 +106,33 @@ static inline int lru_gen_from_seq(unsigned long seq)
+@@ -106,6 +106,33 @@ static inline int lru_gen_from_seq(unsig
        return seq % MAX_NR_GENS;
  }
  
@@ -246,7 +244,7 @@ index 65320d2b8f60..58aabb1ba020 100644
  static inline int page_lru_gen(struct page *page)
  {
        unsigned long flags = READ_ONCE(page->flags);
-@@ -158,6 +185,15 @@ static inline void lru_gen_update_size(struct lruvec *lruvec, struct page *page,
+@@ -158,6 +185,15 @@ static inline void lru_gen_update_size(s
                __update_lru_size(lruvec, lru, zone, -delta);
                return;
        }
@@ -262,8 +260,6 @@ index 65320d2b8f60..58aabb1ba020 100644
  }
  
  static inline bool lru_gen_add_page(struct lruvec *lruvec, struct page *page, bool reclaiming)
-diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
-index 0c39f72184d0..fce8945c507c 100644
 --- a/include/linux/mmzone.h
 +++ b/include/linux/mmzone.h
 @@ -327,6 +327,28 @@ enum lruvec_flags {
@@ -328,8 +324,6 @@ index 0c39f72184d0..fce8945c507c 100644
  };
  
  void lru_gen_init_lruvec(struct lruvec *lruvec);
-diff --git a/include/linux/page-flags-layout.h b/include/linux/page-flags-layout.h
-index 240905407a18..7d79818dc065 100644
 --- a/include/linux/page-flags-layout.h
 +++ b/include/linux/page-flags-layout.h
 @@ -106,7 +106,10 @@
@@ -344,8 +338,6 @@ index 240905407a18..7d79818dc065 100644
  
  #endif
  #endif /* _LINUX_PAGE_FLAGS_LAYOUT */
-diff --git a/kernel/bounds.c b/kernel/bounds.c
-index 5ee60777d8e4..b529182e8b04 100644
 --- a/kernel/bounds.c
 +++ b/kernel/bounds.c
 @@ -24,8 +24,10 @@ int main(void)
@@ -359,8 +351,6 @@ index 5ee60777d8e4..b529182e8b04 100644
  #endif
        /* End of constants */
  
-diff --git a/mm/Kconfig b/mm/Kconfig
-index 0eeb27397884..62433f3cd7ae 100644
 --- a/mm/Kconfig
 +++ b/mm/Kconfig
 @@ -897,6 +897,7 @@ config IO_MAPPING
@@ -388,11 +378,9 @@ index 0eeb27397884..62433f3cd7ae 100644
  source "mm/damon/Kconfig"
  
  endmenu
-diff --git a/mm/swap.c b/mm/swap.c
-index 0bdc96661fb6..5d227577b609 100644
 --- a/mm/swap.c
 +++ b/mm/swap.c
-@@ -389,6 +389,40 @@ static void __lru_cache_activate_page(struct page *page)
+@@ -389,6 +389,40 @@ static void __lru_cache_activate_page(st
        local_unlock(&lru_pvecs.lock);
  }
  
@@ -433,7 +421,7 @@ index 0bdc96661fb6..5d227577b609 100644
  /*
   * Mark a page as having seen activity.
   *
-@@ -403,6 +437,11 @@ void mark_page_accessed(struct page *page)
+@@ -403,6 +437,11 @@ void mark_page_accessed(struct page *pag
  {
        page = compound_head(page);
  
@@ -445,11 +433,9 @@ index 0bdc96661fb6..5d227577b609 100644
        if (!PageReferenced(page)) {
                SetPageReferenced(page);
        } else if (PageUnevictable(page)) {
-diff --git a/mm/vmscan.c b/mm/vmscan.c
-index 41826fe17eb3..932abd24c1b3 100644
 --- a/mm/vmscan.c
 +++ b/mm/vmscan.c
-@@ -1142,9 +1142,11 @@ static int __remove_mapping(struct address_space *mapping, struct page *page,
+@@ -1142,9 +1142,11 @@ static int __remove_mapping(struct addre
  
        if (PageSwapCache(page)) {
                swp_entry_t swap = { .val = page_private(page) };
@@ -462,7 +448,7 @@ index 41826fe17eb3..932abd24c1b3 100644
                __delete_from_swap_cache(page, swap, shadow);
                xa_unlock_irq(&mapping->i_pages);
                put_swap_page(page, swap);
-@@ -2502,6 +2504,9 @@ static void prepare_scan_count(pg_data_t *pgdat, struct scan_control *sc)
+@@ -2502,6 +2504,9 @@ static void prepare_scan_count(pg_data_t
        unsigned long file;
        struct lruvec *target_lruvec;
  
@@ -472,7 +458,7 @@ index 41826fe17eb3..932abd24c1b3 100644
        target_lruvec = mem_cgroup_lruvec(sc->target_mem_cgroup, pgdat);
  
        /*
-@@ -2827,6 +2832,17 @@ static bool can_age_anon_pages(struct pglist_data *pgdat,
+@@ -2827,6 +2832,17 @@ static bool can_age_anon_pages(struct pg
   *                          shorthand helpers
   ******************************************************************************/
  
@@ -490,7 +476,7 @@ index 41826fe17eb3..932abd24c1b3 100644
  #define for_each_gen_type_zone(gen, type, zone)                               \
        for ((gen) = 0; (gen) < MAX_NR_GENS; (gen)++)                   \
                for ((type) = 0; (type) < ANON_AND_FILE; (type)++)      \
-@@ -2852,6 +2868,745 @@ static struct lruvec __maybe_unused *get_lruvec(struct mem_cgroup *memcg, int ni
+@@ -2852,6 +2868,745 @@ static struct lruvec __maybe_unused *get
        return pgdat ? &pgdat->__lruvec : NULL;
  }
  
@@ -1253,7 +1239,7 @@ index 41826fe17eb3..932abd24c1b3 100644
  #endif /* CONFIG_LRU_GEN */
  
  static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
-@@ -2907,6 +3672,11 @@ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
+@@ -2907,6 +3672,11 @@ static void shrink_lruvec(struct lruvec
        bool proportional_reclaim;
        struct blk_plug plug;
  
@@ -1265,7 +1251,7 @@ index 41826fe17eb3..932abd24c1b3 100644
        get_scan_count(lruvec, sc, nr);
  
        /* Record the original scan target for proportional adjustments later */
-@@ -3372,6 +4142,9 @@ static void snapshot_refaults(struct mem_cgroup *target_memcg, pg_data_t *pgdat)
+@@ -3375,6 +4145,9 @@ static void snapshot_refaults(struct mem
        struct lruvec *target_lruvec;
        unsigned long refaults;
  
@@ -1275,7 +1261,7 @@ index 41826fe17eb3..932abd24c1b3 100644
        target_lruvec = mem_cgroup_lruvec(target_memcg, pgdat);
        refaults = lruvec_page_state(target_lruvec, WORKINGSET_ACTIVATE_ANON);
        target_lruvec->refaults[0] = refaults;
-@@ -3736,12 +4509,16 @@ unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *memcg,
+@@ -3739,12 +4512,16 @@ unsigned long try_to_free_mem_cgroup_pag
  }
  #endif
  
@@ -1294,7 +1280,7 @@ index 41826fe17eb3..932abd24c1b3 100644
        if (!can_age_anon_pages(pgdat, sc))
                return;
  
-@@ -4058,12 +4835,11 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int highest_zoneidx)
+@@ -4061,12 +4838,11 @@ restart:
                sc.may_swap = !nr_boost_reclaim;
  
                /*
@@ -1311,11 +1297,9 @@ index 41826fe17eb3..932abd24c1b3 100644
  
                /*
                 * If we're getting trouble reclaiming, start doing writepage
-diff --git a/mm/workingset.c b/mm/workingset.c
-index 880d882f3325..aeba62cebf8c 100644
 --- a/mm/workingset.c
 +++ b/mm/workingset.c
-@@ -187,7 +187,6 @@ static unsigned int bucket_order __read_mostly;
+@@ -187,7 +187,6 @@ static unsigned int bucket_order __read_
  static void *pack_shadow(int memcgid, pg_data_t *pgdat, unsigned long eviction,
                         bool workingset)
  {
@@ -1323,7 +1307,7 @@ index 880d882f3325..aeba62cebf8c 100644
        eviction &= EVICTION_MASK;
        eviction = (eviction << MEM_CGROUP_ID_SHIFT) | memcgid;
        eviction = (eviction << NODES_SHIFT) | pgdat->node_id;
-@@ -212,10 +211,107 @@ static void unpack_shadow(void *shadow, int *memcgidp, pg_data_t **pgdat,
+@@ -212,10 +211,107 @@ static void unpack_shadow(void *shadow,
  
        *memcgidp = memcgid;
        *pgdat = NODE_DATA(nid);
@@ -1432,7 +1416,7 @@ index 880d882f3325..aeba62cebf8c 100644
  /**
   * workingset_age_nonresident - age non-resident entries as LRU ages
   * @lruvec: the lruvec that was aged
-@@ -264,10 +360,14 @@ void *workingset_eviction(struct page *page, struct mem_cgroup *target_memcg)
+@@ -264,10 +360,14 @@ void *workingset_eviction(struct page *p
        VM_BUG_ON_PAGE(page_count(page), page);
        VM_BUG_ON_PAGE(!PageLocked(page), page);
  
@@ -1447,7 +1431,7 @@ index 880d882f3325..aeba62cebf8c 100644
        workingset_age_nonresident(lruvec, thp_nr_pages(page));
        return pack_shadow(memcgid, pgdat, eviction, PageWorkingset(page));
  }
-@@ -296,7 +396,13 @@ void workingset_refault(struct page *page, void *shadow)
+@@ -296,7 +396,13 @@ void workingset_refault(struct page *pag
        bool workingset;
        int memcgid;
  
@@ -1461,6 +1445,3 @@ index 880d882f3325..aeba62cebf8c 100644
  
        rcu_read_lock();
        /*
--- 
-2.40.0
-