Re: [PATCH v3 1/4] sched: cgroup SCHED_IDLE support
From: Daniel Jordan
Date: Wed Sep 01 2021 - 21:22:47 EST
On Thu, Aug 19, 2021 at 06:04:00PM -0700, Josh Don wrote:
> +static int se_is_idle(struct sched_entity *se)
> +{
> + return 0;
> +}
I'm thinking !FAIR_GROUP_SCHED is a rare thing to behold? So not a big
deal, but I think this wants to be
return task_has_idle_policy(task_of(se));
so buddies aren't set for SCHED_IDLE.
> static void set_last_buddy(struct sched_entity *se)
> {
> - if (entity_is_task(se) && unlikely(task_has_idle_policy(task_of(se))))
> - return;
> -
> for_each_sched_entity(se) {
> if (SCHED_WARN_ON(!se->on_rq))
> return;
> + if (se_is_idle(se))
> + return;
> cfs_rq_of(se)->last = se;
> }
> }
>
> static void set_next_buddy(struct sched_entity *se)
> {
> - if (entity_is_task(se) && unlikely(task_has_idle_policy(task_of(se))))
> - return;
> -
> for_each_sched_entity(se) {
> if (SCHED_WARN_ON(!se->on_rq))
> return;
> + if (se_is_idle(se))
> + return;
> cfs_rq_of(se)->next = se;
> }
> }