stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] sched/fair: Fix enqueue_task_fair() warning some more" failed to apply to 5.6-stable tree
@ 2020-05-25 14:42 gregkh
  2020-05-25 15:41 ` Vincent Guittot
  0 siblings, 1 reply; 5+ messages in thread
From: gregkh @ 2020-05-25 14:42 UTC (permalink / raw)
  To: pauld, dietmar.eggemann, peterz, vincent.guittot; +Cc: stable


The patch below does not apply to the 5.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From b34cb07dde7c2346dec73d053ce926aeaa087303 Mon Sep 17 00:00:00 2001
From: Phil Auld <pauld@redhat.com>
Date: Tue, 12 May 2020 09:52:22 -0400
Subject: [PATCH] sched/fair: Fix enqueue_task_fair() warning some more

sched/fair: Fix enqueue_task_fair warning some more

The recent patch, fe61468b2cb (sched/fair: Fix enqueue_task_fair warning)
did not fully resolve the issues with the rq->tmp_alone_branch !=
&rq->leaf_cfs_rq_list warning in enqueue_task_fair. There is a case where
the first for_each_sched_entity loop exits due to on_rq, having incompletely
updated the list.  In this case the second for_each_sched_entity loop can
further modify se. The later code to fix up the list management fails to do
what is needed because se does not point to the sched_entity which broke out
of the first loop. The list is not fixed up because the throttled parent was
already added back to the list by a task enqueue in a parallel child hierarchy.

Address this by calling list_add_leaf_cfs_rq if there are throttled parents
while doing the second for_each_sched_entity loop.

Fixes: fe61468b2cb ("sched/fair: Fix enqueue_task_fair warning")
Suggested-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Phil Auld <pauld@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lkml.kernel.org/r/20200512135222.GC2201@lorien.usersys.redhat.com

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 02f323b85b6d..c6d57c334d51 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5479,6 +5479,13 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
 		/* end evaluation on encountering a throttled cfs_rq */
 		if (cfs_rq_throttled(cfs_rq))
 			goto enqueue_throttle;
+
+               /*
+                * One parent has been throttled and cfs_rq removed from the
+                * list. Add it back to not break the leaf list.
+                */
+               if (throttled_hierarchy(cfs_rq))
+                       list_add_leaf_cfs_rq(cfs_rq);
 	}
 
 enqueue_throttle:


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

* Re: FAILED: patch "[PATCH] sched/fair: Fix enqueue_task_fair() warning some more" failed to apply to 5.6-stable tree
  2020-05-25 14:42 FAILED: patch "[PATCH] sched/fair: Fix enqueue_task_fair() warning some more" failed to apply to 5.6-stable tree gregkh
@ 2020-05-25 15:41 ` Vincent Guittot
  2020-05-25 15:49   ` gregkh
  0 siblings, 1 reply; 5+ messages in thread
From: Vincent Guittot @ 2020-05-25 15:41 UTC (permalink / raw)
  To: gregkh; +Cc: Phil Auld, Dietmar Eggemann, Peter Zijlstra, # v4 . 16+

On Mon, 25 May 2020 at 16:42, <gregkh@linuxfoundation.org> wrote:
>
>
> The patch below does not apply to the 5.6-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.

This patch applies on top of
commit 6d4d22468dae ("sched/fair: Reorder enqueue/dequeue_task_fair path")
commit 5ab297bab984 ("sched/fair: Fix reordering of
enqueue/dequeue_task_fair()")



>
> thanks,
>
> greg k-h
>
> ------------------ original commit in Linus's tree ------------------
>
> From b34cb07dde7c2346dec73d053ce926aeaa087303 Mon Sep 17 00:00:00 2001
> From: Phil Auld <pauld@redhat.com>
> Date: Tue, 12 May 2020 09:52:22 -0400
> Subject: [PATCH] sched/fair: Fix enqueue_task_fair() warning some more
>
> sched/fair: Fix enqueue_task_fair warning some more
>
> The recent patch, fe61468b2cb (sched/fair: Fix enqueue_task_fair warning)
> did not fully resolve the issues with the rq->tmp_alone_branch !=
> &rq->leaf_cfs_rq_list warning in enqueue_task_fair. There is a case where
> the first for_each_sched_entity loop exits due to on_rq, having incompletely
> updated the list.  In this case the second for_each_sched_entity loop can
> further modify se. The later code to fix up the list management fails to do
> what is needed because se does not point to the sched_entity which broke out
> of the first loop. The list is not fixed up because the throttled parent was
> already added back to the list by a task enqueue in a parallel child hierarchy.
>
> Address this by calling list_add_leaf_cfs_rq if there are throttled parents
> while doing the second for_each_sched_entity loop.
>
> Fixes: fe61468b2cb ("sched/fair: Fix enqueue_task_fair warning")
> Suggested-by: Vincent Guittot <vincent.guittot@linaro.org>
> Signed-off-by: Phil Auld <pauld@redhat.com>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
> Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
> Link: https://lkml.kernel.org/r/20200512135222.GC2201@lorien.usersys.redhat.com
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 02f323b85b6d..c6d57c334d51 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -5479,6 +5479,13 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
>                 /* end evaluation on encountering a throttled cfs_rq */
>                 if (cfs_rq_throttled(cfs_rq))
>                         goto enqueue_throttle;
> +
> +               /*
> +                * One parent has been throttled and cfs_rq removed from the
> +                * list. Add it back to not break the leaf list.
> +                */
> +               if (throttled_hierarchy(cfs_rq))
> +                       list_add_leaf_cfs_rq(cfs_rq);
>         }
>
>  enqueue_throttle:
>

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix enqueue_task_fair() warning some more" failed to apply to 5.6-stable tree
  2020-05-25 15:41 ` Vincent Guittot
@ 2020-05-25 15:49   ` gregkh
  2020-05-25 15:55     ` Vincent Guittot
  0 siblings, 1 reply; 5+ messages in thread
From: gregkh @ 2020-05-25 15:49 UTC (permalink / raw)
  To: Vincent Guittot; +Cc: Phil Auld, Dietmar Eggemann, Peter Zijlstra, # v4 . 16+

On Mon, May 25, 2020 at 05:41:36PM +0200, Vincent Guittot wrote:
> On Mon, 25 May 2020 at 16:42, <gregkh@linuxfoundation.org> wrote:
> >
> >
> > The patch below does not apply to the 5.6-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
> 
> This patch applies on top of
> commit 6d4d22468dae ("sched/fair: Reorder enqueue/dequeue_task_fair path")

That applies, but:

> commit 5ab297bab984 ("sched/fair: Fix reordering of
> enqueue/dequeue_task_fair()")

That one does not.

Can you make a backported patch series of these that I can apply easily?

thanks,

greg k-h

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix enqueue_task_fair() warning some more" failed to apply to 5.6-stable tree
  2020-05-25 15:49   ` gregkh
@ 2020-05-25 15:55     ` Vincent Guittot
  2020-05-25 20:55       ` Sasha Levin
  0 siblings, 1 reply; 5+ messages in thread
From: Vincent Guittot @ 2020-05-25 15:55 UTC (permalink / raw)
  To: gregkh; +Cc: Phil Auld, Dietmar Eggemann, Peter Zijlstra, # v4 . 16+

On Mon, 25 May 2020 at 17:49, gregkh@linuxfoundation.org
<gregkh@linuxfoundation.org> wrote:
>
> On Mon, May 25, 2020 at 05:41:36PM +0200, Vincent Guittot wrote:
> > On Mon, 25 May 2020 at 16:42, <gregkh@linuxfoundation.org> wrote:
> > >
> > >
> > > The patch below does not apply to the 5.6-stable tree.
> > > If someone wants it applied there, or to any other stable or longterm
> > > tree, then please email the backport, including the original git commit
> > > id to <stable@vger.kernel.org>.
> >
> > This patch applies on top of
> > commit 6d4d22468dae ("sched/fair: Reorder enqueue/dequeue_task_fair path")
>
> That applies, but:
>
> > commit 5ab297bab984 ("sched/fair: Fix reordering of
> > enqueue/dequeue_task_fair()")
>
> That one does not.
>
> Can you make a backported patch series of these that I can apply easily?

I tested the cherry-pick of the 2 commits above on top of v5.6.14 and
there were applying without error. Should I use another tag ?


>
> thanks,
>
> greg k-h

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix enqueue_task_fair() warning some more" failed to apply to 5.6-stable tree
  2020-05-25 15:55     ` Vincent Guittot
@ 2020-05-25 20:55       ` Sasha Levin
  0 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2020-05-25 20:55 UTC (permalink / raw)
  To: Vincent Guittot
  Cc: gregkh, Phil Auld, Dietmar Eggemann, Peter Zijlstra, # v4 . 16+

On Mon, May 25, 2020 at 05:55:03PM +0200, Vincent Guittot wrote:
>On Mon, 25 May 2020 at 17:49, gregkh@linuxfoundation.org
><gregkh@linuxfoundation.org> wrote:
>>
>> On Mon, May 25, 2020 at 05:41:36PM +0200, Vincent Guittot wrote:
>> > On Mon, 25 May 2020 at 16:42, <gregkh@linuxfoundation.org> wrote:
>> > >
>> > >
>> > > The patch below does not apply to the 5.6-stable tree.
>> > > If someone wants it applied there, or to any other stable or longterm
>> > > tree, then please email the backport, including the original git commit
>> > > id to <stable@vger.kernel.org>.
>> >
>> > This patch applies on top of
>> > commit 6d4d22468dae ("sched/fair: Reorder enqueue/dequeue_task_fair path")
>>
>> That applies, but:
>>
>> > commit 5ab297bab984 ("sched/fair: Fix reordering of
>> > enqueue/dequeue_task_fair()")
>>
>> That one does not.
>>
>> Can you make a backported patch series of these that I can apply easily?
>
>I tested the cherry-pick of the 2 commits above on top of v5.6.14 and
>there were applying without error. Should I use another tag ?

That worked for me, I've queued it up.

-- 
Thanks,
Sasha

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

end of thread, other threads:[~2020-05-25 20:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 14:42 FAILED: patch "[PATCH] sched/fair: Fix enqueue_task_fair() warning some more" failed to apply to 5.6-stable tree gregkh
2020-05-25 15:41 ` Vincent Guittot
2020-05-25 15:49   ` gregkh
2020-05-25 15:55     ` Vincent Guittot
2020-05-25 20:55       ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).