Re: [PATCH 6/6] mm: Drain LRUs upon resume to userspace on nohz_full CPUs

From: Michal Hocko
Date: Thu Jul 03 2025 - 10:24:23 EST


On Thu 03-07-25 16:07:17, Frederic Weisbecker wrote:
[...]
> @@ -864,6 +888,10 @@ static inline void __lru_add_drain_all(bool force_all_cpus)
> for_each_online_cpu(cpu) {
> struct work_struct *work = &per_cpu(lru_add_drain_work, cpu);
>
> + /* Isolated CPUs handle their cache upon return to userspace */
> + if (IS_ENABLED(CONFIG_NO_HZ_FULL_WORK) && !housekeeping_cpu(cpu, HK_TYPE_KERNEL_NOISE))
> + continue;
> +

Two questions. Where do you actually queue the work to be executed on
the return to the userspace? And why don't you do that only if
cpu_needs_drain?

> if (cpu_needs_drain(cpu)) {
> INIT_WORK(work, lru_add_drain_per_cpu);
> queue_work_on(cpu, mm_percpu_wq, work);
> --
> 2.48.1
>

--
Michal Hocko
SUSE Labs