Re: [PATCH 3/3] sched/core: Indicate a sched_delayed task was migrated before wakeup

From: Peter Zijlstra
Date: Fri Oct 11 2024 - 06:40:24 EST


On Fri, Oct 11, 2024 at 06:08:03AM -0400, Johannes Weiner wrote:

> Something like this?

Yeah, something like that indeed :-)

> I like it better too. There is a weird asymmetry between passing
> ENQ_MIGRATED to one and !ENQ_SLEEP to the other both as "migrate".

So I have a note to stare at the whole {EN,DE}QUEUE_MIGRATING,
ENQUEUE_MIGRATED and task_on_rq_migrating() situation, it has the
feeling that something could be done to clean up there.

> No strong preference for whether the ENQUEUE_RESTORE check should be
> in caller or callee, but I figured if we pass the flags anyway...

Right, and this way it's behind the static key, so win, right :-)

> I toyed with a separate branch for ENQUEUE_INITIAL. But it saves one
> branch during fork while adding one to repeat enqueues. The latter
> should be hotter on average, so I removed it again.
>
> Completely untested. But if it looks good, I'll send a proper patch.

Sure. Thanks for doing this.