Re: [PATCH v7 10/23] sched: Split out __sched() deactivate task logic into a helper

From: John Stultz
Date: Thu Dec 21 2023 - 13:49:45 EST


On Thu, Dec 21, 2023 at 4:30 AM Metin Kaya <metin.kaya@xxxxxxx> wrote:
>
> On 20/12/2023 12:18 am, John Stultz wrote:
> > As we're going to re-use the deactivation logic,
> > split it into a helper.
> >
>
> * Better to have a comment (e.g., in which conditions
> try_to_deactivate_task() returns true or false) here.

Ah, good point. I've added a comment to address this.

> * try_to_deactivate_task() is temporarily used by 2 commits in the patch
> set (i.e., it's only called by __schedule() just like in this patch at
> the end of the series). However, it's nice to make that big
> __scheduler() function a bit modular as we discussed off-list. So,
> should we move this function out of the Proxy Execution patch set to get
> it merged independently?

Yeah. I add and later remove the proxy_deactivate() function as it
goes unused, but I am thinking about keeping it to handle the case
where if the blocked on chains are too long, and we're spending too
much time re-running find_proxy_task() - where we should probably just
deactivate the selected task and move on. But for now, you're right.

The suggestion of just the initial step of splitting the logic out
(probably make it a void function because the remaining usage in
__schedule() doesn't care about the result) is a good one, so I'll
rework it this way and send it separately (along with other early
patches Qais suggested).

thanks
-john