stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
@ 2020-11-19 14:56 Guilherme G. Piccoli
  2020-11-19 14:57 ` Guilherme Piccoli
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Guilherme G. Piccoli @ 2020-11-19 14:56 UTC (permalink / raw)
  To: Sasha Levin, peterz, Vincent Guittot
  Cc: bsegall, gregkh, pauld, zohooouoto, stable, Gavin Guo,
	nivedita.singhvi, halves, gpiccoli

Hi Sasha / Peter, is there anything blocking this backport from Vincent
to get merged in 5.4.y?

Thanks in advance,


Guilherme

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-11-19 14:56 FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree Guilherme G. Piccoli
@ 2020-11-19 14:57 ` Guilherme Piccoli
       [not found]   ` <BN8PR12MB297872B12C4DBE0793605F9B9AE00@BN8PR12MB2978.namprd12.prod.outlook.com>
  2020-11-19 18:57 ` Sasha Levin
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 22+ messages in thread
From: Guilherme Piccoli @ 2020-11-19 14:57 UTC (permalink / raw)
  To: Sasha Levin, Peter Zijlstra, Vincent Guittot
  Cc: Ben Segall, Greg KH, Phil Auld, Tao Zhou, # v4 . 16+,
	Gavin Guo, Nivedita Singhvi, Heitor R. Alves de Siqueira

On Thu, Nov 19, 2020 at 11:56 AM Guilherme G. Piccoli
<gpiccoli@canonical.com> wrote:
>
> Hi Sasha / Peter, is there anything blocking this backport from Vincent
> to get merged in 5.4.y?
>
> Thanks in advance,
>
>
> Guilherme

Forgot to mention the original thread link:
https://lore.kernel.org/stable/20200525172709.GB7427@vingu-book/#t

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
       [not found]   ` <BN8PR12MB297872B12C4DBE0793605F9B9AE00@BN8PR12MB2978.namprd12.prod.outlook.com>
@ 2020-11-19 17:45     ` Guilherme Piccoli
  0 siblings, 0 replies; 22+ messages in thread
From: Guilherme Piccoli @ 2020-11-19 17:45 UTC (permalink / raw)
  To: Tao Zhou, Ben Segall, Peter Zijlstra, Phil Auld, Vincent Guittot
  Cc: Sasha Levin, Greg KH, # v4 . 16+,
	Gavin Guo, Nivedita Singhvi, Heitor R. Alves de Siqueira,
	Jay Vosburgh

On Thu, Nov 19, 2020 at 1:44 PM Tao Zhou <ouwen210@hotmail.com> wrote:
> [...]
> That time I realized something, but..
> I try to remember something and get some impression.
>
> We need to update the below when do not need to enqueue entity because
> this is added for runnable_avg updating,
>
>         update_load_avg(cfs_rq, se, UPDATE_TG);
>         se_update_runnable(se);
>
> Earlier version do not introduce the above to only update runnable_avg.
> Use one *for loop* is enough though. Please correct me if I am wrong.
>

Thanks a lot Tao! I'm not sure, I'm definitely not an expert in the
scheduler. Will defer this one to Vincent / Peter / Phil / Ben.
Cheers!

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-11-19 14:56 FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree Guilherme G. Piccoli
  2020-11-19 14:57 ` Guilherme Piccoli
@ 2020-11-19 18:57 ` Sasha Levin
  2020-11-20  5:04   ` Nivedita Singhvi
  2020-12-01 15:03 ` Guilherme G. Piccoli
  2020-12-06  9:57 ` Greg KH
  3 siblings, 1 reply; 22+ messages in thread
From: Sasha Levin @ 2020-11-19 18:57 UTC (permalink / raw)
  To: Guilherme G. Piccoli
  Cc: peterz, Vincent Guittot, bsegall, gregkh, pauld, zohooouoto,
	stable, Gavin Guo, nivedita.singhvi, halves

On Thu, Nov 19, 2020 at 11:56:01AM -0300, Guilherme G. Piccoli wrote:
>Hi Sasha / Peter, is there anything blocking this backport from Vincent
>to get merged in 5.4.y?

An ack from Peter...

-- 
Thanks,
Sasha

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-11-19 18:57 ` Sasha Levin
@ 2020-11-20  5:04   ` Nivedita Singhvi
  0 siblings, 0 replies; 22+ messages in thread
From: Nivedita Singhvi @ 2020-11-20  5:04 UTC (permalink / raw)
  To: Sasha Levin, Guilherme G. Piccoli
  Cc: peterz, Vincent Guittot, bsegall, gregkh, pauld, zohooouoto,
	stable, Gavin Guo, halves, Jay Vosburgh

On 11/20/20 12:27 AM, Sasha Levin wrote:
> On Thu, Nov 19, 2020 at 11:56:01AM -0300, Guilherme G. Piccoli wrote:
>> Hi Sasha / Peter, is there anything blocking this backport from Vincent
>> to get merged in 5.4.y?
>
> An ack from Peter...
>

Hey Peter,

Any concerns with this patch getting merged?  We are seeing
it in production, looks like, so would be good to get it into stable.


Nivedita


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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-11-19 14:56 FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree Guilherme G. Piccoli
  2020-11-19 14:57 ` Guilherme Piccoli
  2020-11-19 18:57 ` Sasha Levin
@ 2020-12-01 15:03 ` Guilherme G. Piccoli
  2020-12-02  7:51   ` Greg KH
  2020-12-06  9:57 ` Greg KH
  3 siblings, 1 reply; 22+ messages in thread
From: Guilherme G. Piccoli @ 2020-12-01 15:03 UTC (permalink / raw)
  To: Sasha Levin, peterz, bsegall, Ingo Molnar
  Cc: Vincent Guittot, gregkh, pauld, zohooouoto, stable, Gavin Guo,
	nivedita.singhvi, halves, Jay Vosburgh

Hey Sasha, sorry to annoy again, but maybe Peter is very busy - wouldn't
be possible maybe to get that merged after a review from Ben or Ingo? I
see them in the MAINTAINERS file, specially Ben as CONFIG_CFS_BANDWIDTH
maintainer.

I understand the confidence in this patch is relatively high, since it's
a backport from the author, right?

Let me know your thoughts, and thanks all in advance!
Cheers,


Guilherme

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-12-01 15:03 ` Guilherme G. Piccoli
@ 2020-12-02  7:51   ` Greg KH
  2020-12-02  8:21     ` Vincent Guittot
  0 siblings, 1 reply; 22+ messages in thread
From: Greg KH @ 2020-12-02  7:51 UTC (permalink / raw)
  To: Guilherme G. Piccoli
  Cc: Sasha Levin, peterz, bsegall, Ingo Molnar, Vincent Guittot,
	pauld, zohooouoto, stable, Gavin Guo, nivedita.singhvi, halves,
	Jay Vosburgh

On Tue, Dec 01, 2020 at 12:03:18PM -0300, Guilherme G. Piccoli wrote:
> Hey Sasha, sorry to annoy again, but maybe Peter is very busy - wouldn't
> be possible maybe to get that merged after a review from Ben or Ingo? I
> see them in the MAINTAINERS file, specially Ben as CONFIG_CFS_BANDWIDTH
> maintainer.
> 
> I understand the confidence in this patch is relatively high, since it's
> a backport from the author, right?

I still want to see an ack from the maintainer please.

thanks,

greg k-h

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-12-02  7:51   ` Greg KH
@ 2020-12-02  8:21     ` Vincent Guittot
  2020-12-02  9:44       ` Peter Zijlstra
  0 siblings, 1 reply; 22+ messages in thread
From: Vincent Guittot @ 2020-12-02  8:21 UTC (permalink / raw)
  To: Greg KH
  Cc: Guilherme G. Piccoli, Sasha Levin, Peter Zijlstra, Ben Segall,
	Ingo Molnar, Phil Auld, Tao Zhou, # v4 . 16+,
	Gavin Guo, nivedita.singhvi, halves, Jay Vosburgh

On Wed, 2 Dec 2020 at 08:49, Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Tue, Dec 01, 2020 at 12:03:18PM -0300, Guilherme G. Piccoli wrote:
> > Hey Sasha, sorry to annoy again, but maybe Peter is very busy - wouldn't
> > be possible maybe to get that merged after a review from Ben or Ingo? I
> > see them in the MAINTAINERS file, specially Ben as CONFIG_CFS_BANDWIDTH
> > maintainer.
> >
> > I understand the confidence in this patch is relatively high, since it's
> > a backport from the author, right?
>
> I still want to see an ack from the maintainer please.

SCHEDULER
M: Ingo Molnar <mingo@redhat.com>
M: Peter Zijlstra <peterz@infradead.org>
M: Juri Lelli <juri.lelli@redhat.com> (SCHED_DEADLINE)
M: Vincent Guittot <vincent.guittot@linaro.org> (SCHED_NORMAL)
R: Dietmar Eggemann <dietmar.eggemann@arm.com> (SCHED_NORMAL)
R: Steven Rostedt <rostedt@goodmis.org> (SCHED_FIFO/SCHED_RR)
R: Ben Segall <bsegall@google.com> (CONFIG_CFS_BANDWIDTH)
R: Mel Gorman <mgorman@suse.de> (CONFIG_NUMA_BALANCING)
L: linux-kernel@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core
S: Maintained
F: kernel/sched/
F: include/linux/sched.h
F: include/uapi/linux/sched.h
F: include/linux/wait.h
F: include/linux/preempt.h

Isn't me and Ben enough in this case ?

>
> thanks,
>
> greg k-h

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-12-02  8:21     ` Vincent Guittot
@ 2020-12-02  9:44       ` Peter Zijlstra
  2020-12-02 13:52         ` Sasha Levin
  0 siblings, 1 reply; 22+ messages in thread
From: Peter Zijlstra @ 2020-12-02  9:44 UTC (permalink / raw)
  To: Vincent Guittot
  Cc: Greg KH, Guilherme G. Piccoli, Sasha Levin, Ben Segall,
	Ingo Molnar, Phil Auld, Tao Zhou, # v4 . 16+,
	Gavin Guo, nivedita.singhvi, halves, Jay Vosburgh

On Wed, Dec 02, 2020 at 09:21:19AM +0100, Vincent Guittot wrote:
> On Wed, 2 Dec 2020 at 08:49, Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Tue, Dec 01, 2020 at 12:03:18PM -0300, Guilherme G. Piccoli wrote:
> > > Hey Sasha, sorry to annoy again, but maybe Peter is very busy - wouldn't
> > > be possible maybe to get that merged after a review from Ben or Ingo? I
> > > see them in the MAINTAINERS file, specially Ben as CONFIG_CFS_BANDWIDTH
> > > maintainer.
> > >
> > > I understand the confidence in this patch is relatively high, since it's
> > > a backport from the author, right?
> >
> > I still want to see an ack from the maintainer please.
> 
> SCHEDULER

> M: Vincent Guittot <vincent.guittot@linaro.org> (SCHED_NORMAL)

Vincent is also the one that knows that leaf code best, he did the
backport, you're not going to get better than that.


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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-12-02  9:44       ` Peter Zijlstra
@ 2020-12-02 13:52         ` Sasha Levin
  0 siblings, 0 replies; 22+ messages in thread
From: Sasha Levin @ 2020-12-02 13:52 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Vincent Guittot, Greg KH, Guilherme G. Piccoli, Ben Segall,
	Ingo Molnar, Phil Auld, Tao Zhou, # v4 . 16+,
	Gavin Guo, nivedita.singhvi, halves, Jay Vosburgh

On Wed, Dec 02, 2020 at 10:44:28AM +0100, Peter Zijlstra wrote:
>On Wed, Dec 02, 2020 at 09:21:19AM +0100, Vincent Guittot wrote:
>> On Wed, 2 Dec 2020 at 08:49, Greg KH <gregkh@linuxfoundation.org> wrote:
>> >
>> > On Tue, Dec 01, 2020 at 12:03:18PM -0300, Guilherme G. Piccoli wrote:
>> > > Hey Sasha, sorry to annoy again, but maybe Peter is very busy - wouldn't
>> > > be possible maybe to get that merged after a review from Ben or Ingo? I
>> > > see them in the MAINTAINERS file, specially Ben as CONFIG_CFS_BANDWIDTH
>> > > maintainer.
>> > >
>> > > I understand the confidence in this patch is relatively high, since it's
>> > > a backport from the author, right?
>> >
>> > I still want to see an ack from the maintainer please.
>>
>> SCHEDULER
>
>> M: Vincent Guittot <vincent.guittot@linaro.org> (SCHED_NORMAL)
>
>Vincent is also the one that knows that leaf code best, he did the
>backport, you're not going to get better than that.

So I've asked for someone else to review this because the backport is
somehat different from the upstream commit. Ideally we want these types
of backports to be peer reviewed, just like any other commit that lands
upstream.

If the sched folks feel good about that backport (as indicated above...)
I'll happily merge it in.

-- 
Thanks,
Sasha

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-11-19 14:56 FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree Guilherme G. Piccoli
                   ` (2 preceding siblings ...)
  2020-12-01 15:03 ` Guilherme G. Piccoli
@ 2020-12-06  9:57 ` Greg KH
  2020-12-11  4:00   ` Nivedita Singhvi
  3 siblings, 1 reply; 22+ messages in thread
From: Greg KH @ 2020-12-06  9:57 UTC (permalink / raw)
  To: Guilherme G. Piccoli
  Cc: Sasha Levin, peterz, Vincent Guittot, bsegall, pauld, zohooouoto,
	stable, Gavin Guo, nivedita.singhvi, halves

On Thu, Nov 19, 2020 at 11:56:01AM -0300, Guilherme G. Piccoli wrote:
> Hi Sasha / Peter, is there anything blocking this backport from Vincent
> to get merged in 5.4.y?

The backport doesn't apply to the tree.  How did you test this?

thanks,

greg k-h

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-12-06  9:57 ` Greg KH
@ 2020-12-11  4:00   ` Nivedita Singhvi
  0 siblings, 0 replies; 22+ messages in thread
From: Nivedita Singhvi @ 2020-12-11  4:00 UTC (permalink / raw)
  To: Greg KH, Guilherme G. Piccoli
  Cc: Sasha Levin, peterz, Vincent Guittot, bsegall, pauld, zohooouoto,
	stable, Gavin Guo, halves

On 12/6/20 3:27 PM, Greg KH wrote:
> On Thu, Nov 19, 2020 at 11:56:01AM -0300, Guilherme G. Piccoli wrote:
>> Hi Sasha / Peter, is there anything blocking this backport from Vincent
>> to get merged in 5.4.y?
> 
> The backport doesn't apply to the tree.  How did you test this?
> 
> thanks,
> 
> greg k-h
> 

Thanks, Greg, Vincent, for sorting this out and committing
to stable upstream..

sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list
commit	294de8933adbdda78acaa3935971d26bb6de745e

I don't have a reproducer but we'll be testing this
to the extent we can beat up on it...


Nivedita



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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-12-06 12:07           ` Greg KH
  2020-12-06 12:10             ` Vincent Guittot
@ 2020-12-06 15:18             ` Sasha Levin
  1 sibling, 0 replies; 22+ messages in thread
From: Sasha Levin @ 2020-12-06 15:18 UTC (permalink / raw)
  To: Greg KH
  Cc: Vincent Guittot, Ben Segall, Phil Auld, Peter Zijlstra, Tao Zhou,
	# v4 . 16+

On Sun, Dec 06, 2020 at 01:07:09PM +0100, Greg KH wrote:
>On Sun, Dec 06, 2020 at 12:54:57PM +0100, Vincent Guittot wrote:
>> On Sun, 6 Dec 2020 at 12:47, Greg KH <gregkh@linuxfoundation.org> wrote:
>> >
>> > On Sun, Dec 06, 2020 at 12:25:12PM +0100, Vincent Guittot wrote:
>> > > On Sun, 6 Dec 2020 at 10:56, Greg KH <gregkh@linuxfoundation.org> wrote:
>> > > >
>> > > > On Mon, May 25, 2020 at 07:27:09PM +0200, Vincent Guittot wrote:
>> > > > > Le lundi 25 mai 2020 à 16:42:49 (+0200), gregkh@linuxfoundation.org a écrit :
>> > > > > >
>> > > > > > The patch below does not apply to the 5.4-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 needs  commit
>> > > > >     b34cb07dde7c ("sched/fair: Fix enqueue_task_fair() warning some more")
>> > > > > to be applied first. But then, it will not apply. The backport is :
>> > > > >
>> > > > > [ Upstream commit 39f23ce07b9355d05a64ae303ce20d1c4b92b957 upstream ]
>> > > > >
>> > > > > Although not exactly identical, unthrottle_cfs_rq() and enqueue_task_fair()
>> > > > > are quite close and follow the same sequence for enqueuing an entity in the
>> > > > > cfs hierarchy. Modify unthrottle_cfs_rq() to use the same pattern as
>> > > > > enqueue_task_fair(). This fixes a problem already faced with the latter and
>> > > > > add an optimization in the last for_each_sched_entity loop.
>> > > > >
>> > > > > Fixes: fe61468b2cb (sched/fair: Fix enqueue_task_fair warning)
>> > > > > Reported-by Tao Zhou <zohooouoto@zoho.com.cn>
>> > > > > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
>> > > > > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>> > > > > Reviewed-by: Phil Auld <pauld@redhat.com>
>> > > > > Reviewed-by: Ben Segall <bsegall@google.com>
>> > > > > Link: https://lkml.kernel.org/r/20200513135528.4742-1-vincent.guittot@linaro.org
>> > > > > ---
>> > > > >  kernel/sched/fair.c | 36 ++++++++++++++++++++++++++++--------
>> > > > >  1 file changed, 28 insertions(+), 8 deletions(-)
>> > > >
>> > > > This patch doesn't apply to the 5.4.y tree at all.  Can someone please
>> > > > provide a working backport?
>> > >
>> > > It seems that commit b34cb07dde7c ("sched/fair: Fix
>> > > enqueue_task_fair() warning some more") has already been applied back
>> > > in May. But then, I'm able to apply this patch on top of
>> > > v5.4.y/v5.4.81
>> > >
>> >
>> > What is "this patch" here?  I tried to apply 39f23ce07b93 ("sched/fair:
>> > Fix unthrottle_cfs_rq() for leaf_cfs_rq list") directly to the 5.4 tree
>> > and it too did not apply.
>>
>> commit 39f23ce07b93 ("sched/fair: Fix unthrottle_cfs_rq() for
>> leaf_cfs_rq list") can't apply because there are several changes which
>> are not fixes which have been applied since v5.4 on the same code.
>>
>> This patch is the backport on v5.4 of the commit 39f23ce07b93
>
>What is "this"?  I tried to apply the above patch to the 5.4.y tree, and
>it didn't apply.  So I still do not understand what I can do here...

It's already in our 5.4 tree I've added it there a few days ago :)

-- 
Thanks,
Sasha

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-12-06 12:07           ` Greg KH
@ 2020-12-06 12:10             ` Vincent Guittot
  2020-12-06 15:18             ` Sasha Levin
  1 sibling, 0 replies; 22+ messages in thread
From: Vincent Guittot @ 2020-12-06 12:10 UTC (permalink / raw)
  To: Greg KH; +Cc: Ben Segall, Phil Auld, Peter Zijlstra, Tao Zhou, # v4 . 16+

On Sun, 6 Dec 2020 at 13:05, Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Sun, Dec 06, 2020 at 12:54:57PM +0100, Vincent Guittot wrote:
> > On Sun, 6 Dec 2020 at 12:47, Greg KH <gregkh@linuxfoundation.org> wrote:
> > >
> > > On Sun, Dec 06, 2020 at 12:25:12PM +0100, Vincent Guittot wrote:
> > > > On Sun, 6 Dec 2020 at 10:56, Greg KH <gregkh@linuxfoundation.org> wrote:
> > > > >
> > > > > On Mon, May 25, 2020 at 07:27:09PM +0200, Vincent Guittot wrote:
> > > > > > Le lundi 25 mai 2020 à 16:42:49 (+0200), gregkh@linuxfoundation.org a écrit :
> > > > > > >
> > > > > > > The patch below does not apply to the 5.4-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 needs  commit
> > > > > >     b34cb07dde7c ("sched/fair: Fix enqueue_task_fair() warning some more")
> > > > > > to be applied first. But then, it will not apply. The backport is :
> > > > > >
> > > > > > [ Upstream commit 39f23ce07b9355d05a64ae303ce20d1c4b92b957 upstream ]
> > > > > >
> > > > > > Although not exactly identical, unthrottle_cfs_rq() and enqueue_task_fair()
> > > > > > are quite close and follow the same sequence for enqueuing an entity in the
> > > > > > cfs hierarchy. Modify unthrottle_cfs_rq() to use the same pattern as
> > > > > > enqueue_task_fair(). This fixes a problem already faced with the latter and
> > > > > > add an optimization in the last for_each_sched_entity loop.
> > > > > >
> > > > > > Fixes: fe61468b2cb (sched/fair: Fix enqueue_task_fair warning)
> > > > > > Reported-by Tao Zhou <zohooouoto@zoho.com.cn>
> > > > > > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> > > > > > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > > > > > Reviewed-by: Phil Auld <pauld@redhat.com>
> > > > > > Reviewed-by: Ben Segall <bsegall@google.com>
> > > > > > Link: https://lkml.kernel.org/r/20200513135528.4742-1-vincent.guittot@linaro.org
> > > > > > ---
> > > > > >  kernel/sched/fair.c | 36 ++++++++++++++++++++++++++++--------
> > > > > >  1 file changed, 28 insertions(+), 8 deletions(-)
> > > > >
> > > > > This patch doesn't apply to the 5.4.y tree at all.  Can someone please
> > > > > provide a working backport?
> > > >
> > > > It seems that commit b34cb07dde7c ("sched/fair: Fix
> > > > enqueue_task_fair() warning some more") has already been applied back
> > > > in May. But then, I'm able to apply this patch on top of
> > > > v5.4.y/v5.4.81
> > > >
> > >
> > > What is "this patch" here?  I tried to apply 39f23ce07b93 ("sched/fair:
> > > Fix unthrottle_cfs_rq() for leaf_cfs_rq list") directly to the 5.4 tree
> > > and it too did not apply.
> >
> > commit 39f23ce07b93 ("sched/fair: Fix unthrottle_cfs_rq() for
> > leaf_cfs_rq list") can't apply because there are several changes which
> > are not fixes which have been applied since v5.4 on the same code.
> >
> > This patch is the backport on v5.4 of the commit 39f23ce07b93
>
> What is "this"?  I tried to apply the above patch to the 5.4.y tree, and

I was referring to the email  <20200525172709.GB7427@vingu-book>

> it didn't apply.  So I still do not understand what I can do here...

Let me resend it with a clean subject title

>
> greg k-h

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-12-06 11:54         ` Vincent Guittot
@ 2020-12-06 12:07           ` Greg KH
  2020-12-06 12:10             ` Vincent Guittot
  2020-12-06 15:18             ` Sasha Levin
  0 siblings, 2 replies; 22+ messages in thread
From: Greg KH @ 2020-12-06 12:07 UTC (permalink / raw)
  To: Vincent Guittot
  Cc: Ben Segall, Phil Auld, Peter Zijlstra, Tao Zhou, # v4 . 16+

On Sun, Dec 06, 2020 at 12:54:57PM +0100, Vincent Guittot wrote:
> On Sun, 6 Dec 2020 at 12:47, Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Sun, Dec 06, 2020 at 12:25:12PM +0100, Vincent Guittot wrote:
> > > On Sun, 6 Dec 2020 at 10:56, Greg KH <gregkh@linuxfoundation.org> wrote:
> > > >
> > > > On Mon, May 25, 2020 at 07:27:09PM +0200, Vincent Guittot wrote:
> > > > > Le lundi 25 mai 2020 à 16:42:49 (+0200), gregkh@linuxfoundation.org a écrit :
> > > > > >
> > > > > > The patch below does not apply to the 5.4-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 needs  commit
> > > > >     b34cb07dde7c ("sched/fair: Fix enqueue_task_fair() warning some more")
> > > > > to be applied first. But then, it will not apply. The backport is :
> > > > >
> > > > > [ Upstream commit 39f23ce07b9355d05a64ae303ce20d1c4b92b957 upstream ]
> > > > >
> > > > > Although not exactly identical, unthrottle_cfs_rq() and enqueue_task_fair()
> > > > > are quite close and follow the same sequence for enqueuing an entity in the
> > > > > cfs hierarchy. Modify unthrottle_cfs_rq() to use the same pattern as
> > > > > enqueue_task_fair(). This fixes a problem already faced with the latter and
> > > > > add an optimization in the last for_each_sched_entity loop.
> > > > >
> > > > > Fixes: fe61468b2cb (sched/fair: Fix enqueue_task_fair warning)
> > > > > Reported-by Tao Zhou <zohooouoto@zoho.com.cn>
> > > > > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> > > > > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > > > > Reviewed-by: Phil Auld <pauld@redhat.com>
> > > > > Reviewed-by: Ben Segall <bsegall@google.com>
> > > > > Link: https://lkml.kernel.org/r/20200513135528.4742-1-vincent.guittot@linaro.org
> > > > > ---
> > > > >  kernel/sched/fair.c | 36 ++++++++++++++++++++++++++++--------
> > > > >  1 file changed, 28 insertions(+), 8 deletions(-)
> > > >
> > > > This patch doesn't apply to the 5.4.y tree at all.  Can someone please
> > > > provide a working backport?
> > >
> > > It seems that commit b34cb07dde7c ("sched/fair: Fix
> > > enqueue_task_fair() warning some more") has already been applied back
> > > in May. But then, I'm able to apply this patch on top of
> > > v5.4.y/v5.4.81
> > >
> >
> > What is "this patch" here?  I tried to apply 39f23ce07b93 ("sched/fair:
> > Fix unthrottle_cfs_rq() for leaf_cfs_rq list") directly to the 5.4 tree
> > and it too did not apply.
> 
> commit 39f23ce07b93 ("sched/fair: Fix unthrottle_cfs_rq() for
> leaf_cfs_rq list") can't apply because there are several changes which
> are not fixes which have been applied since v5.4 on the same code.
> 
> This patch is the backport on v5.4 of the commit 39f23ce07b93

What is "this"?  I tried to apply the above patch to the 5.4.y tree, and
it didn't apply.  So I still do not understand what I can do here...

greg k-h

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-12-06 11:40       ` Greg KH
@ 2020-12-06 11:54         ` Vincent Guittot
  2020-12-06 12:07           ` Greg KH
  0 siblings, 1 reply; 22+ messages in thread
From: Vincent Guittot @ 2020-12-06 11:54 UTC (permalink / raw)
  To: Greg KH; +Cc: Ben Segall, Phil Auld, Peter Zijlstra, Tao Zhou, # v4 . 16+

On Sun, 6 Dec 2020 at 12:47, Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Sun, Dec 06, 2020 at 12:25:12PM +0100, Vincent Guittot wrote:
> > On Sun, 6 Dec 2020 at 10:56, Greg KH <gregkh@linuxfoundation.org> wrote:
> > >
> > > On Mon, May 25, 2020 at 07:27:09PM +0200, Vincent Guittot wrote:
> > > > Le lundi 25 mai 2020 à 16:42:49 (+0200), gregkh@linuxfoundation.org a écrit :
> > > > >
> > > > > The patch below does not apply to the 5.4-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 needs  commit
> > > >     b34cb07dde7c ("sched/fair: Fix enqueue_task_fair() warning some more")
> > > > to be applied first. But then, it will not apply. The backport is :
> > > >
> > > > [ Upstream commit 39f23ce07b9355d05a64ae303ce20d1c4b92b957 upstream ]
> > > >
> > > > Although not exactly identical, unthrottle_cfs_rq() and enqueue_task_fair()
> > > > are quite close and follow the same sequence for enqueuing an entity in the
> > > > cfs hierarchy. Modify unthrottle_cfs_rq() to use the same pattern as
> > > > enqueue_task_fair(). This fixes a problem already faced with the latter and
> > > > add an optimization in the last for_each_sched_entity loop.
> > > >
> > > > Fixes: fe61468b2cb (sched/fair: Fix enqueue_task_fair warning)
> > > > Reported-by Tao Zhou <zohooouoto@zoho.com.cn>
> > > > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> > > > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > > > Reviewed-by: Phil Auld <pauld@redhat.com>
> > > > Reviewed-by: Ben Segall <bsegall@google.com>
> > > > Link: https://lkml.kernel.org/r/20200513135528.4742-1-vincent.guittot@linaro.org
> > > > ---
> > > >  kernel/sched/fair.c | 36 ++++++++++++++++++++++++++++--------
> > > >  1 file changed, 28 insertions(+), 8 deletions(-)
> > >
> > > This patch doesn't apply to the 5.4.y tree at all.  Can someone please
> > > provide a working backport?
> >
> > It seems that commit b34cb07dde7c ("sched/fair: Fix
> > enqueue_task_fair() warning some more") has already been applied back
> > in May. But then, I'm able to apply this patch on top of
> > v5.4.y/v5.4.81
> >
>
> What is "this patch" here?  I tried to apply 39f23ce07b93 ("sched/fair:
> Fix unthrottle_cfs_rq() for leaf_cfs_rq list") directly to the 5.4 tree
> and it too did not apply.

commit 39f23ce07b93 ("sched/fair: Fix unthrottle_cfs_rq() for
leaf_cfs_rq list") can't apply because there are several changes which
are not fixes which have been applied since v5.4 on the same code.

This patch is the backport on v5.4 of the commit 39f23ce07b93

>
> confused,
>
> greg k-h

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-12-06 11:25     ` Vincent Guittot
@ 2020-12-06 11:40       ` Greg KH
  2020-12-06 11:54         ` Vincent Guittot
  0 siblings, 1 reply; 22+ messages in thread
From: Greg KH @ 2020-12-06 11:40 UTC (permalink / raw)
  To: Vincent Guittot
  Cc: Ben Segall, Phil Auld, Peter Zijlstra, Tao Zhou, # v4 . 16+

On Sun, Dec 06, 2020 at 12:25:12PM +0100, Vincent Guittot wrote:
> On Sun, 6 Dec 2020 at 10:56, Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Mon, May 25, 2020 at 07:27:09PM +0200, Vincent Guittot wrote:
> > > Le lundi 25 mai 2020 à 16:42:49 (+0200), gregkh@linuxfoundation.org a écrit :
> > > >
> > > > The patch below does not apply to the 5.4-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 needs  commit
> > >     b34cb07dde7c ("sched/fair: Fix enqueue_task_fair() warning some more")
> > > to be applied first. But then, it will not apply. The backport is :
> > >
> > > [ Upstream commit 39f23ce07b9355d05a64ae303ce20d1c4b92b957 upstream ]
> > >
> > > Although not exactly identical, unthrottle_cfs_rq() and enqueue_task_fair()
> > > are quite close and follow the same sequence for enqueuing an entity in the
> > > cfs hierarchy. Modify unthrottle_cfs_rq() to use the same pattern as
> > > enqueue_task_fair(). This fixes a problem already faced with the latter and
> > > add an optimization in the last for_each_sched_entity loop.
> > >
> > > Fixes: fe61468b2cb (sched/fair: Fix enqueue_task_fair warning)
> > > Reported-by Tao Zhou <zohooouoto@zoho.com.cn>
> > > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> > > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > > Reviewed-by: Phil Auld <pauld@redhat.com>
> > > Reviewed-by: Ben Segall <bsegall@google.com>
> > > Link: https://lkml.kernel.org/r/20200513135528.4742-1-vincent.guittot@linaro.org
> > > ---
> > >  kernel/sched/fair.c | 36 ++++++++++++++++++++++++++++--------
> > >  1 file changed, 28 insertions(+), 8 deletions(-)
> >
> > This patch doesn't apply to the 5.4.y tree at all.  Can someone please
> > provide a working backport?
> 
> It seems that commit b34cb07dde7c ("sched/fair: Fix
> enqueue_task_fair() warning some more") has already been applied back
> in May. But then, I'm able to apply this patch on top of
> v5.4.y/v5.4.81
> 

What is "this patch" here?  I tried to apply 39f23ce07b93 ("sched/fair:
Fix unthrottle_cfs_rq() for leaf_cfs_rq list") directly to the 5.4 tree
and it too did not apply.

confused,

greg k-h

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-12-06  9:57   ` Greg KH
@ 2020-12-06 11:25     ` Vincent Guittot
  2020-12-06 11:40       ` Greg KH
  0 siblings, 1 reply; 22+ messages in thread
From: Vincent Guittot @ 2020-12-06 11:25 UTC (permalink / raw)
  To: Greg KH; +Cc: Ben Segall, Phil Auld, Peter Zijlstra, Tao Zhou, # v4 . 16+

On Sun, 6 Dec 2020 at 10:56, Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Mon, May 25, 2020 at 07:27:09PM +0200, Vincent Guittot wrote:
> > Le lundi 25 mai 2020 à 16:42:49 (+0200), gregkh@linuxfoundation.org a écrit :
> > >
> > > The patch below does not apply to the 5.4-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 needs  commit
> >     b34cb07dde7c ("sched/fair: Fix enqueue_task_fair() warning some more")
> > to be applied first. But then, it will not apply. The backport is :
> >
> > [ Upstream commit 39f23ce07b9355d05a64ae303ce20d1c4b92b957 upstream ]
> >
> > Although not exactly identical, unthrottle_cfs_rq() and enqueue_task_fair()
> > are quite close and follow the same sequence for enqueuing an entity in the
> > cfs hierarchy. Modify unthrottle_cfs_rq() to use the same pattern as
> > enqueue_task_fair(). This fixes a problem already faced with the latter and
> > add an optimization in the last for_each_sched_entity loop.
> >
> > Fixes: fe61468b2cb (sched/fair: Fix enqueue_task_fair warning)
> > Reported-by Tao Zhou <zohooouoto@zoho.com.cn>
> > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > Reviewed-by: Phil Auld <pauld@redhat.com>
> > Reviewed-by: Ben Segall <bsegall@google.com>
> > Link: https://lkml.kernel.org/r/20200513135528.4742-1-vincent.guittot@linaro.org
> > ---
> >  kernel/sched/fair.c | 36 ++++++++++++++++++++++++++++--------
> >  1 file changed, 28 insertions(+), 8 deletions(-)
>
> This patch doesn't apply to the 5.4.y tree at all.  Can someone please
> provide a working backport?

It seems that commit b34cb07dde7c ("sched/fair: Fix
enqueue_task_fair() warning some more") has already been applied back
in May. But then, I'm able to apply this patch on top of
v5.4.y/v5.4.81

Thanks

>
> thanks,
>
> greg k-h

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-05-25 17:27 ` Vincent Guittot
  2020-05-26  0:22   ` Sasha Levin
@ 2020-12-06  9:57   ` Greg KH
  2020-12-06 11:25     ` Vincent Guittot
  1 sibling, 1 reply; 22+ messages in thread
From: Greg KH @ 2020-12-06  9:57 UTC (permalink / raw)
  To: Vincent Guittot; +Cc: bsegall, pauld, peterz, zohooouoto, stable

On Mon, May 25, 2020 at 07:27:09PM +0200, Vincent Guittot wrote:
> Le lundi 25 mai 2020 à 16:42:49 (+0200), gregkh@linuxfoundation.org a écrit :
> > 
> > The patch below does not apply to the 5.4-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 needs  commit
>     b34cb07dde7c ("sched/fair: Fix enqueue_task_fair() warning some more")
> to be applied first. But then, it will not apply. The backport is :
> 
> [ Upstream commit 39f23ce07b9355d05a64ae303ce20d1c4b92b957 upstream ]
> 
> Although not exactly identical, unthrottle_cfs_rq() and enqueue_task_fair()
> are quite close and follow the same sequence for enqueuing an entity in the
> cfs hierarchy. Modify unthrottle_cfs_rq() to use the same pattern as
> enqueue_task_fair(). This fixes a problem already faced with the latter and
> add an optimization in the last for_each_sched_entity loop.
> 
> Fixes: fe61468b2cb (sched/fair: Fix enqueue_task_fair warning)
> Reported-by Tao Zhou <zohooouoto@zoho.com.cn>
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Reviewed-by: Phil Auld <pauld@redhat.com>
> Reviewed-by: Ben Segall <bsegall@google.com>
> Link: https://lkml.kernel.org/r/20200513135528.4742-1-vincent.guittot@linaro.org
> ---
>  kernel/sched/fair.c | 36 ++++++++++++++++++++++++++++--------
>  1 file changed, 28 insertions(+), 8 deletions(-)

This patch doesn't apply to the 5.4.y tree at all.  Can someone please
provide a working backport?

thanks,

greg k-h

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-05-25 17:27 ` Vincent Guittot
@ 2020-05-26  0:22   ` Sasha Levin
  2020-12-06  9:57   ` Greg KH
  1 sibling, 0 replies; 22+ messages in thread
From: Sasha Levin @ 2020-05-26  0:22 UTC (permalink / raw)
  To: Vincent Guittot; +Cc: gregkh, bsegall, pauld, peterz, zohooouoto, stable

On Mon, May 25, 2020 at 07:27:09PM +0200, Vincent Guittot wrote:
>Le lundi 25 mai 2020 à 16:42:49 (+0200), gregkh@linuxfoundation.org a écrit :
>>
>> The patch below does not apply to the 5.4-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 needs  commit
>    b34cb07dde7c ("sched/fair: Fix enqueue_task_fair() warning some more")
>to be applied first. But then, it will not apply. The backport is :
>
>[ Upstream commit 39f23ce07b9355d05a64ae303ce20d1c4b92b957 upstream ]
>
>Although not exactly identical, unthrottle_cfs_rq() and enqueue_task_fair()
>are quite close and follow the same sequence for enqueuing an entity in the
>cfs hierarchy. Modify unthrottle_cfs_rq() to use the same pattern as
>enqueue_task_fair(). This fixes a problem already faced with the latter and
>add an optimization in the last for_each_sched_entity loop.
>
>Fixes: fe61468b2cb (sched/fair: Fix enqueue_task_fair warning)
>Reported-by Tao Zhou <zohooouoto@zoho.com.cn>
>Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
>Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>Reviewed-by: Phil Auld <pauld@redhat.com>
>Reviewed-by: Ben Segall <bsegall@google.com>
>Link: https://lkml.kernel.org/r/20200513135528.4742-1-vincent.guittot@linaro.org

Peter, could you review/ack the backport please? It's very different
from the upstream version.

-- 
Thanks,
Sasha

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

* Re: FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
  2020-05-25 14:42 gregkh
@ 2020-05-25 17:27 ` Vincent Guittot
  2020-05-26  0:22   ` Sasha Levin
  2020-12-06  9:57   ` Greg KH
  0 siblings, 2 replies; 22+ messages in thread
From: Vincent Guittot @ 2020-05-25 17:27 UTC (permalink / raw)
  To: gregkh; +Cc: bsegall, pauld, peterz, zohooouoto, stable

Le lundi 25 mai 2020 à 16:42:49 (+0200), gregkh@linuxfoundation.org a écrit :
> 
> The patch below does not apply to the 5.4-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 needs  commit
    b34cb07dde7c ("sched/fair: Fix enqueue_task_fair() warning some more")
to be applied first. But then, it will not apply. The backport is :

[ Upstream commit 39f23ce07b9355d05a64ae303ce20d1c4b92b957 upstream ]

Although not exactly identical, unthrottle_cfs_rq() and enqueue_task_fair()
are quite close and follow the same sequence for enqueuing an entity in the
cfs hierarchy. Modify unthrottle_cfs_rq() to use the same pattern as
enqueue_task_fair(). This fixes a problem already faced with the latter and
add an optimization in the last for_each_sched_entity loop.

Fixes: fe61468b2cb (sched/fair: Fix enqueue_task_fair warning)
Reported-by Tao Zhou <zohooouoto@zoho.com.cn>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Phil Auld <pauld@redhat.com>
Reviewed-by: Ben Segall <bsegall@google.com>
Link: https://lkml.kernel.org/r/20200513135528.4742-1-vincent.guittot@linaro.org
---
 kernel/sched/fair.c | 36 ++++++++++++++++++++++++++++--------
 1 file changed, 28 insertions(+), 8 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 193b6ab74d7f..36e3bb990845 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4560,7 +4560,6 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)
 	struct rq *rq = rq_of(cfs_rq);
 	struct cfs_bandwidth *cfs_b = tg_cfs_bandwidth(cfs_rq->tg);
 	struct sched_entity *se;
-	int enqueue = 1;
 	long task_delta, idle_task_delta;

 	se = cfs_rq->tg->se[cpu_of(rq)];
@@ -4584,21 +4583,41 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)
 	idle_task_delta = cfs_rq->idle_h_nr_running;
 	for_each_sched_entity(se) {
 		if (se->on_rq)
-			enqueue = 0;
+			break;
+		cfs_rq = cfs_rq_of(se);
+		enqueue_entity(cfs_rq, se, ENQUEUE_WAKEUP);
+
+		cfs_rq->h_nr_running += task_delta;
+		cfs_rq->idle_h_nr_running += idle_task_delta;

+		/* end evaluation on encountering a throttled cfs_rq */
+		if (cfs_rq_throttled(cfs_rq))
+			goto unthrottle_throttle;
+	}
+
+	for_each_sched_entity(se) {
 		cfs_rq = cfs_rq_of(se);
-		if (enqueue)
-			enqueue_entity(cfs_rq, se, ENQUEUE_WAKEUP);
+
 		cfs_rq->h_nr_running += task_delta;
 		cfs_rq->idle_h_nr_running += idle_task_delta;

+
+		/* end evaluation on encountering a throttled cfs_rq */
 		if (cfs_rq_throttled(cfs_rq))
-			break;
+			goto unthrottle_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);
 	}

-	if (!se)
-		add_nr_running(rq, task_delta);
+	/* At this point se is NULL and we are at root level*/
+	add_nr_running(rq, task_delta);

+unthrottle_throttle:
 	/*
 	 * The cfs_rq_throttled() breaks in the above iteration can result in
 	 * incomplete leaf list maintenance, resulting in triggering the
@@ -4607,7 +4626,8 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)
 	for_each_sched_entity(se) {
 		cfs_rq = cfs_rq_of(se);

-		list_add_leaf_cfs_rq(cfs_rq);
+		if (list_add_leaf_cfs_rq(cfs_rq))
+			break;
 	}

 	assert_list_leaf_cfs_rq(rq);
--
2.17.1
 

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

* FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree
@ 2020-05-25 14:42 gregkh
  2020-05-25 17:27 ` Vincent Guittot
  0 siblings, 1 reply; 22+ messages in thread
From: gregkh @ 2020-05-25 14:42 UTC (permalink / raw)
  To: vincent.guittot, bsegall, pauld, peterz, zohooouoto; +Cc: stable


The patch below does not apply to the 5.4-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 39f23ce07b9355d05a64ae303ce20d1c4b92b957 Mon Sep 17 00:00:00 2001
From: Vincent Guittot <vincent.guittot@linaro.org>
Date: Wed, 13 May 2020 15:55:28 +0200
Subject: [PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list

Although not exactly identical, unthrottle_cfs_rq() and enqueue_task_fair()
are quite close and follow the same sequence for enqueuing an entity in the
cfs hierarchy. Modify unthrottle_cfs_rq() to use the same pattern as
enqueue_task_fair(). This fixes a problem already faced with the latter and
add an optimization in the last for_each_sched_entity loop.

Fixes: fe61468b2cb (sched/fair: Fix enqueue_task_fair warning)
Reported-by Tao Zhou <zohooouoto@zoho.com.cn>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Phil Auld <pauld@redhat.com>
Reviewed-by: Ben Segall <bsegall@google.com>
Link: https://lkml.kernel.org/r/20200513135528.4742-1-vincent.guittot@linaro.org

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c6d57c334d51..538ba5d94e99 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4774,7 +4774,6 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)
 	struct rq *rq = rq_of(cfs_rq);
 	struct cfs_bandwidth *cfs_b = tg_cfs_bandwidth(cfs_rq->tg);
 	struct sched_entity *se;
-	int enqueue = 1;
 	long task_delta, idle_task_delta;
 
 	se = cfs_rq->tg->se[cpu_of(rq)];
@@ -4798,26 +4797,44 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)
 	idle_task_delta = cfs_rq->idle_h_nr_running;
 	for_each_sched_entity(se) {
 		if (se->on_rq)
-			enqueue = 0;
+			break;
+		cfs_rq = cfs_rq_of(se);
+		enqueue_entity(cfs_rq, se, ENQUEUE_WAKEUP);
 
+		cfs_rq->h_nr_running += task_delta;
+		cfs_rq->idle_h_nr_running += idle_task_delta;
+
+		/* end evaluation on encountering a throttled cfs_rq */
+		if (cfs_rq_throttled(cfs_rq))
+			goto unthrottle_throttle;
+	}
+
+	for_each_sched_entity(se) {
 		cfs_rq = cfs_rq_of(se);
-		if (enqueue) {
-			enqueue_entity(cfs_rq, se, ENQUEUE_WAKEUP);
-		} else {
-			update_load_avg(cfs_rq, se, 0);
-			se_update_runnable(se);
-		}
+
+		update_load_avg(cfs_rq, se, UPDATE_TG);
+		se_update_runnable(se);
 
 		cfs_rq->h_nr_running += task_delta;
 		cfs_rq->idle_h_nr_running += idle_task_delta;
 
+
+		/* end evaluation on encountering a throttled cfs_rq */
 		if (cfs_rq_throttled(cfs_rq))
-			break;
+			goto unthrottle_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);
 	}
 
-	if (!se)
-		add_nr_running(rq, task_delta);
+	/* At this point se is NULL and we are at root level*/
+	add_nr_running(rq, task_delta);
 
+unthrottle_throttle:
 	/*
 	 * The cfs_rq_throttled() breaks in the above iteration can result in
 	 * incomplete leaf list maintenance, resulting in triggering the
@@ -4826,7 +4843,8 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)
 	for_each_sched_entity(se) {
 		cfs_rq = cfs_rq_of(se);
 
-		list_add_leaf_cfs_rq(cfs_rq);
+		if (list_add_leaf_cfs_rq(cfs_rq))
+			break;
 	}
 
 	assert_list_leaf_cfs_rq(rq);


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

end of thread, other threads:[~2020-12-11  4:02 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 14:56 FAILED: patch "[PATCH] sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list" failed to apply to 5.4-stable tree Guilherme G. Piccoli
2020-11-19 14:57 ` Guilherme Piccoli
     [not found]   ` <BN8PR12MB297872B12C4DBE0793605F9B9AE00@BN8PR12MB2978.namprd12.prod.outlook.com>
2020-11-19 17:45     ` Guilherme Piccoli
2020-11-19 18:57 ` Sasha Levin
2020-11-20  5:04   ` Nivedita Singhvi
2020-12-01 15:03 ` Guilherme G. Piccoli
2020-12-02  7:51   ` Greg KH
2020-12-02  8:21     ` Vincent Guittot
2020-12-02  9:44       ` Peter Zijlstra
2020-12-02 13:52         ` Sasha Levin
2020-12-06  9:57 ` Greg KH
2020-12-11  4:00   ` Nivedita Singhvi
  -- strict thread matches above, loose matches on Subject: below --
2020-05-25 14:42 gregkh
2020-05-25 17:27 ` Vincent Guittot
2020-05-26  0:22   ` Sasha Levin
2020-12-06  9:57   ` Greg KH
2020-12-06 11:25     ` Vincent Guittot
2020-12-06 11:40       ` Greg KH
2020-12-06 11:54         ` Vincent Guittot
2020-12-06 12:07           ` Greg KH
2020-12-06 12:10             ` Vincent Guittot
2020-12-06 15:18             ` 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).