Re: [PATCH 4.4 173/268] sched/rt: Fix rq->clock_update_flags < RQCF_ACT_SKIP warning

2018-06-19 Thread Davidlohr Bueso

On Thu, 14 Jun 2018, Steven Rostedt wrote:


Although the change log is a bit ambiguous in if it is fixing an actual
miss update, or if it is just quieting a false positive.

Davidlohr?


It fixes an update, not a false positive.

Thanks,
Davidlohr


Re: [PATCH 4.4 173/268] sched/rt: Fix rq->clock_update_flags < RQCF_ACT_SKIP warning

2018-06-19 Thread Davidlohr Bueso

On Thu, 14 Jun 2018, Steven Rostedt wrote:


Although the change log is a bit ambiguous in if it is fixing an actual
miss update, or if it is just quieting a false positive.

Davidlohr?


It fixes an update, not a false positive.

Thanks,
Davidlohr


Re: [PATCH 4.4 173/268] sched/rt: Fix rq->clock_update_flags < RQCF_ACT_SKIP warning

2018-06-14 Thread Steven Rostedt
On Thu, 14 Jun 2018 22:55:56 +0100
Ben Hutchings  wrote:

> On Mon, 2018-05-28 at 12:02 +0200, Greg Kroah-Hartman wrote:
> > 4.4-stable review patch.  If anyone has any objections, please let me know.
> > 
> > --
> > 
> > From: Davidlohr Bueso 
> > 
> > [ Upstream commit d29a20645d5e929aa7e8616f28e5d8e1c49263ec ]
> > 
> > While running rt-tests' pi_stress program I got the following splat:
> > 
> >   rq->clock_update_flags < RQCF_ACT_SKIP
> >   WARNING: CPU: 27 PID: 0 at kernel/sched/sched.h:960 
> > assert_clock_updated.isra.38.part.39+0x13/0x20
> > 
> >   [...]
> > 
> >   
> >   enqueue_top_rt_rq+0xf4/0x150
> >   ? cpufreq_dbs_governor_start+0x170/0x170
> >   sched_rt_rq_enqueue+0x65/0x80
> >   sched_rt_period_timer+0x156/0x360
> >   ? sched_rt_rq_enqueue+0x80/0x80
> >   __hrtimer_run_queues+0xfa/0x260
> >   hrtimer_interrupt+0xcb/0x220
> >   smp_apic_timer_interrupt+0x62/0x120
> >   apic_timer_interrupt+0xf/0x20
> >   
> > 
> >   [...]
> > 
> >   do_idle+0x183/0x1e0
> >   cpu_startup_entry+0x5f/0x70
> >   start_secondary+0x192/0x1d0
> >   secondary_startup_64+0xa5/0xb0
> > 
> > We can get rid of it be the "traditional" means of adding an
> > update_rq_clock() call after acquiring the rq->lock in
> > do_sched_rt_period_timer().
> > 
> > The case for the RT task throttling (which this workload also hits)
> > can be ignored in that the skip_update call is actually bogus and
> > quite the contrary (the request bits are removed/reverted).
> > 
> > By setting RQCF_UPDATED we really don't care if the skip is happening
> > or not and will therefore make the assert_clock_updated() check happy.  
> 
> There is no such flag or assertion in 4.4 or 4.9, so does this change
> still make sense there?

I believe the assert was added to catch bugs like this.

Although the change log is a bit ambiguous in if it is fixing an actual
miss update, or if it is just quieting a false positive.

Davidlohr?

-- Steve


> 
> Ben.
> 
> > Signed-off-by: Davidlohr Bueso 
> > Reviewed-by: Matt Fleming 
> > Acked-by: Peter Zijlstra (Intel) 
> > Cc: Linus Torvalds 
> > Cc: Mike Galbraith 
> > Cc: Thomas Gleixner 
> > Cc: d...@stgolabs.net
> > Cc: linux-kernel@vger.kernel.org
> > Cc: rost...@goodmis.org
> > Link: http://lkml.kernel.org/r/20180402164954.16255-1-d...@stgolabs.net
> > Signed-off-by: Ingo Molnar 
> > Signed-off-by: Sasha Levin 
> > Signed-off-by: Greg Kroah-Hartman 
> > ---
> >  kernel/sched/rt.c |2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > --- a/kernel/sched/rt.c
> > +++ b/kernel/sched/rt.c
> > @@ -822,6 +822,8 @@ static int do_sched_rt_period_timer(stru
> >     struct rq *rq = rq_of_rt_rq(rt_rq);
> >  
> >     raw_spin_lock(>lock);
> > +   update_rq_clock(rq);
> > +
> >     if (rt_rq->rt_time) {
> >     u64 runtime;
> >  
> > 
> > 
> >   



Re: [PATCH 4.4 173/268] sched/rt: Fix rq->clock_update_flags < RQCF_ACT_SKIP warning

2018-06-14 Thread Steven Rostedt
On Thu, 14 Jun 2018 22:55:56 +0100
Ben Hutchings  wrote:

> On Mon, 2018-05-28 at 12:02 +0200, Greg Kroah-Hartman wrote:
> > 4.4-stable review patch.  If anyone has any objections, please let me know.
> > 
> > --
> > 
> > From: Davidlohr Bueso 
> > 
> > [ Upstream commit d29a20645d5e929aa7e8616f28e5d8e1c49263ec ]
> > 
> > While running rt-tests' pi_stress program I got the following splat:
> > 
> >   rq->clock_update_flags < RQCF_ACT_SKIP
> >   WARNING: CPU: 27 PID: 0 at kernel/sched/sched.h:960 
> > assert_clock_updated.isra.38.part.39+0x13/0x20
> > 
> >   [...]
> > 
> >   
> >   enqueue_top_rt_rq+0xf4/0x150
> >   ? cpufreq_dbs_governor_start+0x170/0x170
> >   sched_rt_rq_enqueue+0x65/0x80
> >   sched_rt_period_timer+0x156/0x360
> >   ? sched_rt_rq_enqueue+0x80/0x80
> >   __hrtimer_run_queues+0xfa/0x260
> >   hrtimer_interrupt+0xcb/0x220
> >   smp_apic_timer_interrupt+0x62/0x120
> >   apic_timer_interrupt+0xf/0x20
> >   
> > 
> >   [...]
> > 
> >   do_idle+0x183/0x1e0
> >   cpu_startup_entry+0x5f/0x70
> >   start_secondary+0x192/0x1d0
> >   secondary_startup_64+0xa5/0xb0
> > 
> > We can get rid of it be the "traditional" means of adding an
> > update_rq_clock() call after acquiring the rq->lock in
> > do_sched_rt_period_timer().
> > 
> > The case for the RT task throttling (which this workload also hits)
> > can be ignored in that the skip_update call is actually bogus and
> > quite the contrary (the request bits are removed/reverted).
> > 
> > By setting RQCF_UPDATED we really don't care if the skip is happening
> > or not and will therefore make the assert_clock_updated() check happy.  
> 
> There is no such flag or assertion in 4.4 or 4.9, so does this change
> still make sense there?

I believe the assert was added to catch bugs like this.

Although the change log is a bit ambiguous in if it is fixing an actual
miss update, or if it is just quieting a false positive.

Davidlohr?

-- Steve


> 
> Ben.
> 
> > Signed-off-by: Davidlohr Bueso 
> > Reviewed-by: Matt Fleming 
> > Acked-by: Peter Zijlstra (Intel) 
> > Cc: Linus Torvalds 
> > Cc: Mike Galbraith 
> > Cc: Thomas Gleixner 
> > Cc: d...@stgolabs.net
> > Cc: linux-kernel@vger.kernel.org
> > Cc: rost...@goodmis.org
> > Link: http://lkml.kernel.org/r/20180402164954.16255-1-d...@stgolabs.net
> > Signed-off-by: Ingo Molnar 
> > Signed-off-by: Sasha Levin 
> > Signed-off-by: Greg Kroah-Hartman 
> > ---
> >  kernel/sched/rt.c |2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > --- a/kernel/sched/rt.c
> > +++ b/kernel/sched/rt.c
> > @@ -822,6 +822,8 @@ static int do_sched_rt_period_timer(stru
> >     struct rq *rq = rq_of_rt_rq(rt_rq);
> >  
> >     raw_spin_lock(>lock);
> > +   update_rq_clock(rq);
> > +
> >     if (rt_rq->rt_time) {
> >     u64 runtime;
> >  
> > 
> > 
> >   



Re: [PATCH 4.4 173/268] sched/rt: Fix rq->clock_update_flags < RQCF_ACT_SKIP warning

2018-06-14 Thread Ben Hutchings
On Mon, 2018-05-28 at 12:02 +0200, Greg Kroah-Hartman wrote:
> 4.4-stable review patch.  If anyone has any objections, please let me know.
> 
> --
> 
> From: Davidlohr Bueso 
> 
> [ Upstream commit d29a20645d5e929aa7e8616f28e5d8e1c49263ec ]
> 
> While running rt-tests' pi_stress program I got the following splat:
> 
>   rq->clock_update_flags < RQCF_ACT_SKIP
>   WARNING: CPU: 27 PID: 0 at kernel/sched/sched.h:960 
> assert_clock_updated.isra.38.part.39+0x13/0x20
> 
>   [...]
> 
>   
>   enqueue_top_rt_rq+0xf4/0x150
>   ? cpufreq_dbs_governor_start+0x170/0x170
>   sched_rt_rq_enqueue+0x65/0x80
>   sched_rt_period_timer+0x156/0x360
>   ? sched_rt_rq_enqueue+0x80/0x80
>   __hrtimer_run_queues+0xfa/0x260
>   hrtimer_interrupt+0xcb/0x220
>   smp_apic_timer_interrupt+0x62/0x120
>   apic_timer_interrupt+0xf/0x20
>   
> 
>   [...]
> 
>   do_idle+0x183/0x1e0
>   cpu_startup_entry+0x5f/0x70
>   start_secondary+0x192/0x1d0
>   secondary_startup_64+0xa5/0xb0
> 
> We can get rid of it be the "traditional" means of adding an
> update_rq_clock() call after acquiring the rq->lock in
> do_sched_rt_period_timer().
> 
> The case for the RT task throttling (which this workload also hits)
> can be ignored in that the skip_update call is actually bogus and
> quite the contrary (the request bits are removed/reverted).
> 
> By setting RQCF_UPDATED we really don't care if the skip is happening
> or not and will therefore make the assert_clock_updated() check happy.

There is no such flag or assertion in 4.4 or 4.9, so does this change
still make sense there?

Ben.

> Signed-off-by: Davidlohr Bueso 
> Reviewed-by: Matt Fleming 
> Acked-by: Peter Zijlstra (Intel) 
> Cc: Linus Torvalds 
> Cc: Mike Galbraith 
> Cc: Thomas Gleixner 
> Cc: d...@stgolabs.net
> Cc: linux-kernel@vger.kernel.org
> Cc: rost...@goodmis.org
> Link: http://lkml.kernel.org/r/20180402164954.16255-1-d...@stgolabs.net
> Signed-off-by: Ingo Molnar 
> Signed-off-by: Sasha Levin 
> Signed-off-by: Greg Kroah-Hartman 
> ---
>  kernel/sched/rt.c |2 ++
>  1 file changed, 2 insertions(+)
> 
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -822,6 +822,8 @@ static int do_sched_rt_period_timer(stru
>   struct rq *rq = rq_of_rt_rq(rt_rq);
>  
>   raw_spin_lock(>lock);
> + update_rq_clock(rq);
> +
>   if (rt_rq->rt_time) {
>   u64 runtime;
>  
> 
> 
> 
-- 
Ben Hutchings, Software Developer Codethink Ltd
https://www.codethink.co.uk/ Dale House, 35 Dale Street
 Manchester, M1 2HF, United Kingdom


Re: [PATCH 4.4 173/268] sched/rt: Fix rq->clock_update_flags < RQCF_ACT_SKIP warning

2018-06-14 Thread Ben Hutchings
On Mon, 2018-05-28 at 12:02 +0200, Greg Kroah-Hartman wrote:
> 4.4-stable review patch.  If anyone has any objections, please let me know.
> 
> --
> 
> From: Davidlohr Bueso 
> 
> [ Upstream commit d29a20645d5e929aa7e8616f28e5d8e1c49263ec ]
> 
> While running rt-tests' pi_stress program I got the following splat:
> 
>   rq->clock_update_flags < RQCF_ACT_SKIP
>   WARNING: CPU: 27 PID: 0 at kernel/sched/sched.h:960 
> assert_clock_updated.isra.38.part.39+0x13/0x20
> 
>   [...]
> 
>   
>   enqueue_top_rt_rq+0xf4/0x150
>   ? cpufreq_dbs_governor_start+0x170/0x170
>   sched_rt_rq_enqueue+0x65/0x80
>   sched_rt_period_timer+0x156/0x360
>   ? sched_rt_rq_enqueue+0x80/0x80
>   __hrtimer_run_queues+0xfa/0x260
>   hrtimer_interrupt+0xcb/0x220
>   smp_apic_timer_interrupt+0x62/0x120
>   apic_timer_interrupt+0xf/0x20
>   
> 
>   [...]
> 
>   do_idle+0x183/0x1e0
>   cpu_startup_entry+0x5f/0x70
>   start_secondary+0x192/0x1d0
>   secondary_startup_64+0xa5/0xb0
> 
> We can get rid of it be the "traditional" means of adding an
> update_rq_clock() call after acquiring the rq->lock in
> do_sched_rt_period_timer().
> 
> The case for the RT task throttling (which this workload also hits)
> can be ignored in that the skip_update call is actually bogus and
> quite the contrary (the request bits are removed/reverted).
> 
> By setting RQCF_UPDATED we really don't care if the skip is happening
> or not and will therefore make the assert_clock_updated() check happy.

There is no such flag or assertion in 4.4 or 4.9, so does this change
still make sense there?

Ben.

> Signed-off-by: Davidlohr Bueso 
> Reviewed-by: Matt Fleming 
> Acked-by: Peter Zijlstra (Intel) 
> Cc: Linus Torvalds 
> Cc: Mike Galbraith 
> Cc: Thomas Gleixner 
> Cc: d...@stgolabs.net
> Cc: linux-kernel@vger.kernel.org
> Cc: rost...@goodmis.org
> Link: http://lkml.kernel.org/r/20180402164954.16255-1-d...@stgolabs.net
> Signed-off-by: Ingo Molnar 
> Signed-off-by: Sasha Levin 
> Signed-off-by: Greg Kroah-Hartman 
> ---
>  kernel/sched/rt.c |2 ++
>  1 file changed, 2 insertions(+)
> 
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -822,6 +822,8 @@ static int do_sched_rt_period_timer(stru
>   struct rq *rq = rq_of_rt_rq(rt_rq);
>  
>   raw_spin_lock(>lock);
> + update_rq_clock(rq);
> +
>   if (rt_rq->rt_time) {
>   u64 runtime;
>  
> 
> 
> 
-- 
Ben Hutchings, Software Developer Codethink Ltd
https://www.codethink.co.uk/ Dale House, 35 Dale Street
 Manchester, M1 2HF, United Kingdom