Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-12 Thread Dietmar Eggemann
On 12/10/2020 13:28, Peter Zijlstra wrote: > On Mon, Oct 12, 2020 at 11:56:09AM +0200, Dietmar Eggemann wrote: >> On 05/10/2020 16:57, Peter Zijlstra wrote: >> >> [...] >> >>> --- a/kernel/sched/rt.c >>> +++ b/kernel/sched/rt.c >>> @@ -1859,7 +1859,7 @@ static struct task_struct *pick_next_pus >>>

Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-12 Thread Peter Zijlstra
On Mon, Oct 12, 2020 at 11:56:09AM +0200, Dietmar Eggemann wrote: > On 05/10/2020 16:57, Peter Zijlstra wrote: > > [...] > > > --- a/kernel/sched/rt.c > > +++ b/kernel/sched/rt.c > > @@ -1859,7 +1859,7 @@ static struct task_struct *pick_next_pus > > * running task can migrate over to a CPU

Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-12 Thread Dietmar Eggemann
On 05/10/2020 16:57, Peter Zijlstra wrote: [...] > --- a/kernel/sched/rt.c > +++ b/kernel/sched/rt.c > @@ -1859,7 +1859,7 @@ static struct task_struct *pick_next_pus > * running task can migrate over to a CPU that is running a task > * of lesser priority. > */ > -static int

Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-08 Thread Sebastian Andrzej Siewior
On 2020-10-05 16:57:32 [+0200], Peter Zijlstra wrote: > In order to minimize the interference of migrate_disable() on lower > priority tasks, which can be deprived of runtime due to being stuck > below a higher priority task. Teach the RT/DL balancers to push away > these higher priority tasks

Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-07 Thread Valentin Schneider
On 07/10/20 22:08, Peter Zijlstra wrote: > On Wed, Oct 07, 2020 at 08:22:44PM +0100, Valentin Schneider wrote: >> +struct task_struct *curr = class->peek_next_task(rq); > > If you look at the core-sched patches they have something very similar > :-) Shiny, there's the fair thing I

Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-07 Thread Peter Zijlstra
On Wed, Oct 07, 2020 at 08:22:44PM +0100, Valentin Schneider wrote: > + struct task_struct *curr = class->peek_next_task(rq); If you look at the core-sched patches they have something very similar :-)

Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-07 Thread Valentin Schneider
On 05/10/20 15:57, Peter Zijlstra wrote: > In order to minimize the interference of migrate_disable() on lower > priority tasks, which can be deprived of runtime due to being stuck > below a higher priority task. Teach the RT/DL balancers to push away > these higher priority tasks when a lower

Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-06 Thread Juri Lelli
On 06/10/20 16:48, Peter Zijlstra wrote: > On Tue, Oct 06, 2020 at 04:37:04PM +0200, Juri Lelli wrote: > > On 06/10/20 15:48, Peter Zijlstra wrote: > > > On Tue, Oct 06, 2020 at 12:20:43PM +0100, Valentin Schneider wrote: > > > > > > > > On 05/10/20 15:57, Peter Zijlstra wrote: > > > > > In order

Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-06 Thread Valentin Schneider
On 06/10/20 14:48, Peter Zijlstra wrote: > On Tue, Oct 06, 2020 at 12:20:43PM +0100, Valentin Schneider wrote: >> >> An alternative I could see would be to prevent those piles from forming >> altogether, say by issuing a similar push_cpu_stop() on migrate_disable() >> if the next pushable task

Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-06 Thread Peter Zijlstra
On Tue, Oct 06, 2020 at 04:37:04PM +0200, Juri Lelli wrote: > On 06/10/20 15:48, Peter Zijlstra wrote: > > On Tue, Oct 06, 2020 at 12:20:43PM +0100, Valentin Schneider wrote: > > > > > > On 05/10/20 15:57, Peter Zijlstra wrote: > > > > In order to minimize the interference of migrate_disable() on

Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-06 Thread Juri Lelli
On 06/10/20 15:48, Peter Zijlstra wrote: > On Tue, Oct 06, 2020 at 12:20:43PM +0100, Valentin Schneider wrote: > > > > On 05/10/20 15:57, Peter Zijlstra wrote: > > > In order to minimize the interference of migrate_disable() on lower > > > priority tasks, which can be deprived of runtime due to

Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-06 Thread Peter Zijlstra
On Tue, Oct 06, 2020 at 09:44:45AM -0400, Steven Rostedt wrote: > As I've always said. When dealing with real-time systems, you need to be > careful about how you organize your tasks. Ideally, any RT task that is > pinned to a CPU shouldn't be sharing that CPU with anything else that may > be

Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-06 Thread Peter Zijlstra
On Tue, Oct 06, 2020 at 12:20:43PM +0100, Valentin Schneider wrote: > > On 05/10/20 15:57, Peter Zijlstra wrote: > > In order to minimize the interference of migrate_disable() on lower > > priority tasks, which can be deprived of runtime due to being stuck > > below a higher priority task. Teach

Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-06 Thread Steven Rostedt
On Tue, 6 Oct 2020 09:59:39 +0200 Peter Zijlstra wrote: > On Mon, Oct 05, 2020 at 04:57:32PM +0200, Peter Zijlstra wrote: > > +static inline struct task_struct *get_push_task(struct rq *rq) > > +{ > > + struct task_struct *p = rq->curr; > > + > > + lockdep_assert_held(>lock); > > + > > +

Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-06 Thread Valentin Schneider
On 05/10/20 15:57, Peter Zijlstra wrote: > In order to minimize the interference of migrate_disable() on lower > priority tasks, which can be deprived of runtime due to being stuck > below a higher priority task. Teach the RT/DL balancers to push away > these higher priority tasks when a lower

Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-06 Thread Peter Zijlstra
On Mon, Oct 05, 2020 at 04:57:32PM +0200, Peter Zijlstra wrote: > +static inline struct task_struct *get_push_task(struct rq *rq) > +{ > + struct task_struct *p = rq->curr; > + > + lockdep_assert_held(>lock); > + > + if (rq->push_busy) > + return NULL; > + > + if

[PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing

2020-10-05 Thread Peter Zijlstra
In order to minimize the interference of migrate_disable() on lower priority tasks, which can be deprived of runtime due to being stuck below a higher priority task. Teach the RT/DL balancers to push away these higher priority tasks when a lower priority task gets selected to run on a freshly