sched/fair: use folio_xchg_access_time() in numa_hint_fault_latency()
[sfrench/cifs-2.6.git] / kernel / sched / fair.c
index cb225921bbca47419eeac08a96c98ac74a57ced2..3ee9d3564c20cb90211bf8350a86ddaff28f79e4 100644 (file)
@@ -1722,12 +1722,12 @@ static bool pgdat_free_space_enough(struct pglist_data *pgdat)
  * The smaller the hint page fault latency, the higher the possibility
  * for the page to be hot.
  */
-static int numa_hint_fault_latency(struct page *page)
+static int numa_hint_fault_latency(struct folio *folio)
 {
        int last_time, time;
 
        time = jiffies_to_msecs(jiffies);
-       last_time = xchg_page_access_time(page, time);
+       last_time = folio_xchg_access_time(folio, time);
 
        return (time - last_time) & PAGE_ACCESS_TIME_MASK;
 }
@@ -1784,7 +1784,7 @@ static void numa_promotion_adjust_threshold(struct pglist_data *pgdat,
        }
 }
 
-bool should_numa_migrate_memory(struct task_struct *p, struct page * page,
+bool should_numa_migrate_memory(struct task_struct *p, struct folio *folio,
                                int src_nid, int dst_cpu)
 {
        struct numa_group *ng = deref_curr_numa_group(p);
@@ -1814,16 +1814,16 @@ bool should_numa_migrate_memory(struct task_struct *p, struct page * page,
                numa_promotion_adjust_threshold(pgdat, rate_limit, def_th);
 
                th = pgdat->nbp_threshold ? : def_th;
-               latency = numa_hint_fault_latency(page);
+               latency = numa_hint_fault_latency(folio);
                if (latency >= th)
                        return false;
 
                return !numa_promotion_rate_limit(pgdat, rate_limit,
-                                                 thp_nr_pages(page));
+                                                 folio_nr_pages(folio));
        }
 
        this_cpupid = cpu_pid_to_cpupid(dst_cpu, current->pid);
-       last_cpupid = page_cpupid_xchg_last(page, this_cpupid);
+       last_cpupid = page_cpupid_xchg_last(&folio->page, this_cpupid);
 
        if (!(sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) &&
            !node_is_toptier(src_nid) && !cpupid_valid(last_cpupid))