mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched/fair: Fix se_is_idle() for !FAIR_GROUP_SCHED
@ 2021-09-08 20:39 Daniel Jordan
  2021-09-08 20:56 ` Josh Don
  2021-09-09  6:48 ` Vincent Guittot
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Jordan @ 2021-09-08 20:39 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira
  Cc: Josh Don, linux-kernel, Daniel Jordan

se_is_idle() unconditionally returns 0 for !FAIR_GROUP_SCHED.

Check whether the task is SCHED_IDLE instead so buddies aren't set for
such tasks, as was the behavior before 304000390f88.

Fixes: 304000390f88 ("sched: Cgroup SCHED_IDLE support")
Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com>
---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index ff69f245b939..8b22665bc18e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -497,7 +497,7 @@ static int cfs_rq_is_idle(struct cfs_rq *cfs_rq)
 
 static int se_is_idle(struct sched_entity *se)
 {
-	return 0;
+	return task_has_idle_policy(task_of(se));
 }
 
 #endif	/* CONFIG_FAIR_GROUP_SCHED */

base-commit: ac08b1c68d1b1ed3cebb218fc3ea2c07484eb07d
-- 
2.32.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched/fair: Fix se_is_idle() for !FAIR_GROUP_SCHED
  2021-09-08 20:39 [PATCH] sched/fair: Fix se_is_idle() for !FAIR_GROUP_SCHED Daniel Jordan
@ 2021-09-08 20:56 ` Josh Don
  2021-09-09  6:48 ` Vincent Guittot
  1 sibling, 0 replies; 3+ messages in thread
From: Josh Don @ 2021-09-08 20:56 UTC (permalink / raw)
  To: Daniel Jordan
  Cc: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, linux-kernel

On Wed, Sep 8, 2021 at 1:40 PM Daniel Jordan <daniel.m.jordan@oracle.com> wrote:
>
> se_is_idle() unconditionally returns 0 for !FAIR_GROUP_SCHED.
>
> Check whether the task is SCHED_IDLE instead so buddies aren't set for
> such tasks, as was the behavior before 304000390f88.
>
> Fixes: 304000390f88 ("sched: Cgroup SCHED_IDLE support")
> Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com>

Thanks!

Reviewed-by: Josh Don <joshdon@google.com>

> ---
>  kernel/sched/fair.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index ff69f245b939..8b22665bc18e 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -497,7 +497,7 @@ static int cfs_rq_is_idle(struct cfs_rq *cfs_rq)
>
>  static int se_is_idle(struct sched_entity *se)
>  {
> -       return 0;
> +       return task_has_idle_policy(task_of(se));
>  }
>
>  #endif /* CONFIG_FAIR_GROUP_SCHED */
>
> base-commit: ac08b1c68d1b1ed3cebb218fc3ea2c07484eb07d
> --
> 2.32.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched/fair: Fix se_is_idle() for !FAIR_GROUP_SCHED
  2021-09-08 20:39 [PATCH] sched/fair: Fix se_is_idle() for !FAIR_GROUP_SCHED Daniel Jordan
  2021-09-08 20:56 ` Josh Don
@ 2021-09-09  6:48 ` Vincent Guittot
  1 sibling, 0 replies; 3+ messages in thread
From: Vincent Guittot @ 2021-09-09  6:48 UTC (permalink / raw)
  To: Daniel Jordan
  Cc: Ingo Molnar, Peter Zijlstra, Juri Lelli, Dietmar Eggemann,
	Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, Josh Don, linux-kernel

On Wed, 8 Sept 2021 at 22:40, Daniel Jordan <daniel.m.jordan@oracle.com> wrote:
>
> se_is_idle() unconditionally returns 0 for !FAIR_GROUP_SCHED.
>
> Check whether the task is SCHED_IDLE instead so buddies aren't set for
> such tasks, as was the behavior before 304000390f88.
>
> Fixes: 304000390f88 ("sched: Cgroup SCHED_IDLE support")
> Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com>

Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>

> ---
>  kernel/sched/fair.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index ff69f245b939..8b22665bc18e 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -497,7 +497,7 @@ static int cfs_rq_is_idle(struct cfs_rq *cfs_rq)
>
>  static int se_is_idle(struct sched_entity *se)
>  {
> -       return 0;
> +       return task_has_idle_policy(task_of(se));
>  }
>
>  #endif /* CONFIG_FAIR_GROUP_SCHED */
>
> base-commit: ac08b1c68d1b1ed3cebb218fc3ea2c07484eb07d
> --
> 2.32.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-09  6:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 20:39 [PATCH] sched/fair: Fix se_is_idle() for !FAIR_GROUP_SCHED Daniel Jordan
2021-09-08 20:56 ` Josh Don
2021-09-09  6:48 ` Vincent Guittot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®