kernel: backport list_count_nodes()
[openwrt/openwrt.git] / target / linux / generic / backport-5.15 / 020-v6.3-22-mm-multi-gen-LRU-rename-lrugen-lists-to-lrugen-pages.patch
index 2e1783661ddb114e7b3d2aa809369ece4e594641..b548c1c8b3de6732ce6f3bc22a6008a073caec32 100644 (file)
@@ -23,11 +23,9 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  mm/vmscan.c               | 20 ++++++++++----------
  3 files changed, 16 insertions(+), 16 deletions(-)
 
-diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
-index 27c4890503c5..4adc9ba59569 100644
 --- a/include/linux/mm_inline.h
 +++ b/include/linux/mm_inline.h
-@@ -246,9 +246,9 @@ static inline bool lru_gen_add_page(struct lruvec *lruvec, struct page *page, bo
+@@ -246,9 +246,9 @@ static inline bool lru_gen_add_page(stru
        lru_gen_update_size(lruvec, page, -1, gen);
        /* for rotate_reclaimable_page() */
        if (reclaiming)
@@ -39,8 +37,6 @@ index 27c4890503c5..4adc9ba59569 100644
  
        return true;
  }
-diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
-index 5856b026c089..7b8a26aaf381 100644
 --- a/include/linux/mmzone.h
 +++ b/include/linux/mmzone.h
 @@ -302,7 +302,7 @@ enum lruvec_flags {
@@ -72,11 +68,9 @@ index 5856b026c089..7b8a26aaf381 100644
        /* the multi-gen LRU sizes, eventually consistent */
        long nr_pages[MAX_NR_GENS][ANON_AND_FILE][MAX_NR_ZONES];
        /* the exponential moving average of refaulted */
-diff --git a/mm/vmscan.c b/mm/vmscan.c
-index 3b1b5bd9736a..2322c913aa64 100644
 --- a/mm/vmscan.c
 +++ b/mm/vmscan.c
-@@ -3987,7 +3987,7 @@ static bool inc_min_seq(struct lruvec *lruvec, int type, bool can_swap)
+@@ -3987,7 +3987,7 @@ static bool inc_min_seq(struct lruvec *l
  
        /* prevent cold/hot inversion if force_scan is true */
        for (zone = 0; zone < MAX_NR_ZONES; zone++) {
@@ -85,7 +79,7 @@ index 3b1b5bd9736a..2322c913aa64 100644
  
                while (!list_empty(head)) {
                        struct page *page = lru_to_page(head);
-@@ -3998,7 +3998,7 @@ static bool inc_min_seq(struct lruvec *lruvec, int type, bool can_swap)
+@@ -3998,7 +3998,7 @@ static bool inc_min_seq(struct lruvec *l
                        VM_WARN_ON_ONCE_PAGE(page_zonenum(page) != zone, page);
  
                        new_gen = page_inc_gen(lruvec, page, false);
@@ -94,7 +88,7 @@ index 3b1b5bd9736a..2322c913aa64 100644
  
                        if (!--remaining)
                                return false;
-@@ -4026,7 +4026,7 @@ static bool try_to_inc_min_seq(struct lruvec *lruvec, bool can_swap)
+@@ -4026,7 +4026,7 @@ static bool try_to_inc_min_seq(struct lr
                        gen = lru_gen_from_seq(min_seq[type]);
  
                        for (zone = 0; zone < MAX_NR_ZONES; zone++) {
@@ -103,7 +97,7 @@ index 3b1b5bd9736a..2322c913aa64 100644
                                        goto next;
                        }
  
-@@ -4491,7 +4491,7 @@ static bool sort_page(struct lruvec *lruvec, struct page *page, int tier_idx)
+@@ -4491,7 +4491,7 @@ static bool sort_page(struct lruvec *lru
  
        /* promoted */
        if (gen != lru_gen_from_seq(lrugen->min_seq[type])) {
@@ -112,7 +106,7 @@ index 3b1b5bd9736a..2322c913aa64 100644
                return true;
        }
  
-@@ -4500,7 +4500,7 @@ static bool sort_page(struct lruvec *lruvec, struct page *page, int tier_idx)
+@@ -4500,7 +4500,7 @@ static bool sort_page(struct lruvec *lru
                int hist = lru_hist_from_seq(lrugen->min_seq[type]);
  
                gen = page_inc_gen(lruvec, page, false);
@@ -121,7 +115,7 @@ index 3b1b5bd9736a..2322c913aa64 100644
  
                WRITE_ONCE(lrugen->protected[hist][type][tier - 1],
                           lrugen->protected[hist][type][tier - 1] + delta);
-@@ -4512,7 +4512,7 @@ static bool sort_page(struct lruvec *lruvec, struct page *page, int tier_idx)
+@@ -4512,7 +4512,7 @@ static bool sort_page(struct lruvec *lru
        if (PageLocked(page) || PageWriteback(page) ||
            (type == LRU_GEN_FILE && PageDirty(page))) {
                gen = page_inc_gen(lruvec, page, true);
@@ -130,7 +124,7 @@ index 3b1b5bd9736a..2322c913aa64 100644
                return true;
        }
  
-@@ -4579,7 +4579,7 @@ static int scan_pages(struct lruvec *lruvec, struct scan_control *sc,
+@@ -4579,7 +4579,7 @@ static int scan_pages(struct lruvec *lru
        for (zone = sc->reclaim_idx; zone >= 0; zone--) {
                LIST_HEAD(moved);
                int skipped = 0;
@@ -139,7 +133,7 @@ index 3b1b5bd9736a..2322c913aa64 100644
  
                while (!list_empty(head)) {
                        struct page *page = lru_to_page(head);
-@@ -4980,7 +4980,7 @@ static bool __maybe_unused state_is_valid(struct lruvec *lruvec)
+@@ -4980,7 +4980,7 @@ static bool __maybe_unused state_is_vali
                int gen, type, zone;
  
                for_each_gen_type_zone(gen, type, zone) {
@@ -148,7 +142,7 @@ index 3b1b5bd9736a..2322c913aa64 100644
                                return false;
                }
        }
-@@ -5025,7 +5025,7 @@ static bool drain_evictable(struct lruvec *lruvec)
+@@ -5025,7 +5025,7 @@ static bool drain_evictable(struct lruve
        int remaining = MAX_LRU_BATCH;
  
        for_each_gen_type_zone(gen, type, zone) {
@@ -157,7 +151,7 @@ index 3b1b5bd9736a..2322c913aa64 100644
  
                while (!list_empty(head)) {
                        bool success;
-@@ -5558,7 +5558,7 @@ void lru_gen_init_lruvec(struct lruvec *lruvec)
+@@ -5558,7 +5558,7 @@ void lru_gen_init_lruvec(struct lruvec *
                lrugen->timestamps[i] = jiffies;
  
        for_each_gen_type_zone(gen, type, zone)
@@ -166,6 +160,3 @@ index 3b1b5bd9736a..2322c913aa64 100644
  
        lruvec->mm_state.seq = MIN_NR_GENS;
        init_waitqueue_head(&lruvec->mm_state.wait);
--- 
-2.40.0
-