Re: [PATCH 0/6 v3] sched/mm: LRU drain flush on nohz_full

From: Hillf Danton
Date: Wed Jul 02 2025 - 07:55:28 EST


On Tue, 1 Jul 2025 14:36:49 +0200 Frederic Weisbecker wrote
>Le Sat, Apr 12, 2025 at 10:58:22AM +0800, Hillf Danton a �it :
>> On Thu, 10 Apr 2025 17:23:21 +0200 Frederic Weisbecker wrote
>> > Hi,
>> >
>> > When LRUs are pending, the drain can be triggered remotely, whether the
>> > remote CPU is running in userspace in nohz_full mode or not. This kind
>> > of noise is expected to be caused by preparatory work before a task
>> > runs isolated in userspace. This patchset is a proposal to flush that
>> > before the task starts its critical work in userspace.
>> >
>> Alternatively add a syscall for workloads on isolated CPUs to flush
>> this xxx and prepare that yyy before entering the critical work, instead
>> of adding random (nice) patches today and next month. Even prctl can
>> do lru_add_and_bh_lrus_drain(), and prctl looks more preferable over
>> adding a syscall.
>
>In an ideal world, this is indeed what we should do now. And I still wish we
>can do this in the future.
>
>The problem is that this has been tried by the past and the work was never
>finished because that syscall eventually didn't meet the need for the people
>working on it.
>
>I would volunteer to start a simple prctl to do such a flush, something that
>can be extended in the future, should the need arise, but such a new ABI must
>be thought through along with the CPU isolation community.
>
>Unfortunately there is no such stable CPU isolation community. Many developers
>in this area contribute changes and then switch to other things. As for the CPU
>isolation users, they are usually very quiet.
>
Given your footprint in the MAINTAINERS file,

HIGH-RESOLUTION TIMERS, TIMER WHEEL, CLOCKEVENTS
M: Anna-Maria Behnsen <anna-maria@xxxxxxxxxxxxx>
M: Frederic Weisbecker <frederic@xxxxxxxxxx>
M: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

NOHZ, DYNTICKS SUPPORT
M: Anna-Maria Behnsen <anna-maria@xxxxxxxxxxxxx>
M: Frederic Weisbecker <frederic@xxxxxxxxxx>
M: Ingo Molnar <mingo@xxxxxxxxxx>
M: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

POSIX CLOCKS and TIMERS
M: Anna-Maria Behnsen <anna-maria@xxxxxxxxxxxxx>
M: Frederic Weisbecker <frederic@xxxxxxxxxx>
M: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

READ-COPY UPDATE (RCU)
M: "Paul E. McKenney" <paulmck@xxxxxxxxxx>
M: Frederic Weisbecker <frederic@xxxxxxxxxx> (kernel/rcu/tree_nocb.h)
M: Neeraj Upadhyay <neeraj.upadhyay@xxxxxxxxxx> (kernel/rcu/tasks.h)
M: Joel Fernandes <joel@xxxxxxxxxxxxxxxxx>
M: Josh Triplett <josh@xxxxxxxxxxxxxxxx>
M: Boqun Feng <boqun.feng@xxxxxxxxx>
M: Uladzislau Rezki <urezki@xxxxxxxxx>

I am happy to close the chance for you to deliver patch like a starter.

>I can't assume all the possible usecases myself and therefore I would easily do
>it wrong.
>
>In the meantime, the patchset here is a proposal that hopefully should work for
>many usecases.
>
>Thanks.
>
>--
>Frederic Weisbecker
>SUSE Labs