kernel: refresh patches for Linux 6.1
[openwrt/openwrt.git] / target / linux / generic / backport-6.1 / 020-v6.3-04-BACKPORT-mm-multi-gen-LRU-remove-aging-fairness-safe.patch
index c3f534a9e0c719f65ca2f3785fce873d5fa44997..87ed87a52d08bed9c80e8defb4e9ae41df2a803e 100644 (file)
@@ -42,8 +42,6 @@ Signed-off-by: T.J. Mercier <tjmercier@google.com>
  mm/vmscan.c | 126 ++++++++++++++++++++++++----------------------------
  1 file changed, 59 insertions(+), 67 deletions(-)
 
-diff --git a/mm/vmscan.c b/mm/vmscan.c
-index 991961180b320..5a2e83e673232 100644
 --- a/mm/vmscan.c
 +++ b/mm/vmscan.c
 @@ -136,7 +136,6 @@ struct scan_control {
@@ -54,7 +52,7 @@ index 991961180b320..5a2e83e673232 100644
        unsigned long last_reclaimed;
  #endif
  
-@@ -4455,7 +4454,7 @@ static bool try_to_inc_max_seq(struct lruvec *lruvec, unsigned long max_seq,
+@@ -4455,7 +4454,7 @@ done:
        return true;
  }
  
@@ -63,7 +61,7 @@ index 991961180b320..5a2e83e673232 100644
                             struct scan_control *sc, bool can_swap, unsigned long *nr_to_scan)
  {
        int gen, type, zone;
-@@ -4464,6 +4463,13 @@ static bool should_run_aging(struct lruvec *lruvec, unsigned long max_seq, unsig
+@@ -4464,6 +4463,13 @@ static bool should_run_aging(struct lruv
        unsigned long total = 0;
        struct lru_gen_folio *lrugen = &lruvec->lrugen;
        struct mem_cgroup *memcg = lruvec_memcg(lruvec);
@@ -77,7 +75,7 @@ index 991961180b320..5a2e83e673232 100644
  
        for (type = !can_swap; type < ANON_AND_FILE; type++) {
                unsigned long seq;
-@@ -4492,8 +4498,6 @@ static bool should_run_aging(struct lruvec *lruvec, unsigned long max_seq, unsig
+@@ -4492,8 +4498,6 @@ static bool should_run_aging(struct lruv
         * stalls when the number of generations reaches MIN_NR_GENS. Hence, the
         * ideal number of generations is MIN_NR_GENS+1.
         */
@@ -86,7 +84,7 @@ index 991961180b320..5a2e83e673232 100644
        if (min_seq[!can_swap] + MIN_NR_GENS < max_seq)
                return false;
  
-@@ -4512,40 +4516,54 @@ static bool should_run_aging(struct lruvec *lruvec, unsigned long max_seq, unsig
+@@ -4512,40 +4516,54 @@ static bool should_run_aging(struct lruv
        return false;
  }
  
@@ -162,7 +160,7 @@ index 991961180b320..5a2e83e673232 100644
  }
  
  /* to protect the working set of the last N jiffies */
-@@ -4554,46 +4572,32 @@ static unsigned long lru_gen_min_ttl __read_mostly;
+@@ -4554,46 +4572,32 @@ static unsigned long lru_gen_min_ttl __r
  static void lru_gen_age_node(struct pglist_data *pgdat, struct scan_control *sc)
  {
        struct mem_cgroup *memcg;
@@ -216,7 +214,7 @@ index 991961180b320..5a2e83e673232 100644
         */
        if (mutex_trylock(&oom_lock)) {
                struct oom_control oc = {
-@@ -5101,33 +5105,27 @@ static int evict_folios(struct lruvec *lruvec, struct scan_control *sc, int swap
+@@ -5101,33 +5105,27 @@ retry:
   *    reclaim.
   */
  static unsigned long get_nr_to_scan(struct lruvec *lruvec, struct scan_control *sc,
@@ -256,7 +254,7 @@ index 991961180b320..5a2e83e673232 100644
  }
  
  static unsigned long get_nr_to_reclaim(struct scan_control *sc)
-@@ -5146,9 +5144,7 @@ static unsigned long get_nr_to_reclaim(struct scan_control *sc)
+@@ -5146,9 +5144,7 @@ static unsigned long get_nr_to_reclaim(s
  static void lru_gen_shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
  {
        struct blk_plug plug;
@@ -266,7 +264,7 @@ index 991961180b320..5a2e83e673232 100644
        unsigned long nr_to_reclaim = get_nr_to_reclaim(sc);
  
        lru_add_drain();
-@@ -5169,13 +5165,13 @@ static void lru_gen_shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc
+@@ -5169,13 +5165,13 @@ static void lru_gen_shrink_lruvec(struct
                else
                        swappiness = 0;
  
@@ -283,7 +281,7 @@ index 991961180b320..5a2e83e673232 100644
  
                scanned += delta;
                if (scanned >= nr_to_scan)
-@@ -5187,10 +5183,6 @@ static void lru_gen_shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc
+@@ -5187,10 +5183,6 @@ static void lru_gen_shrink_lruvec(struct
                cond_resched();
        }
  
@@ -294,6 +292,3 @@ index 991961180b320..5a2e83e673232 100644
        clear_mm_walk();
  
        blk_finish_plug(&plug);
--- 
-2.40.1
-