Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1431798 > unrolled thread

[PATCH] sched/fair: avoid !CONFIG_SMP cpufreq update callbacks when go idle

Started byJisheng Zhang <jszhang@marvell.com>
First post2016-06-27 10:10 +0200
Last post2016-06-27 10:50 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] sched/fair: avoid !CONFIG_SMP cpufreq update callbacks when go idle Jisheng Zhang <jszhang@marvell.com> - 2016-06-27 10:10 +0200
    Re: [PATCH] sched/fair: avoid !CONFIG_SMP cpufreq update callbacks  when go idle Peter Zijlstra <peterz@infradead.org> - 2016-06-27 10:40 +0200
      Re: [PATCH] sched/fair: avoid !CONFIG_SMP cpufreq update callbacks  when go idle Jisheng Zhang <jszhang@marvell.com> - 2016-06-27 10:50 +0200

#1431798 — [PATCH] sched/fair: avoid !CONFIG_SMP cpufreq update callbacks when go idle

FromJisheng Zhang <jszhang@marvell.com>
Date2016-06-27 10:10 +0200
Subject[PATCH] sched/fair: avoid !CONFIG_SMP cpufreq update callbacks when go idle
Message-ID<rOzMf-62T-55@gated-at.bofh.it>
This is to avoid cpufreq update callbacks when we go idle on UP
platforms.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 kernel/sched/fair.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index bdcbeea..236ec5b 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3121,7 +3121,8 @@ static inline void update_load_avg(struct sched_entity *se, int not_used)
 	struct cfs_rq *cfs_rq = cfs_rq_of(se);
 	struct rq *rq = rq_of(cfs_rq);
 
-	cpufreq_trigger_update(rq_clock(rq));
+	if (&rq->cfs == cfs_rq)
+		cpufreq_trigger_update(rq_clock(rq));
 }
 
 static inline void
-- 
2.8.1

[toc] | [next] | [standalone]


#1431815 — Re: [PATCH] sched/fair: avoid !CONFIG_SMP cpufreq update callbacks when go idle

FromPeter Zijlstra <peterz@infradead.org>
Date2016-06-27 10:40 +0200
SubjectRe: [PATCH] sched/fair: avoid !CONFIG_SMP cpufreq update callbacks when go idle
Message-ID<rOAfg-6cY-15@gated-at.bofh.it>
In reply to#1431798
On Mon, Jun 27, 2016 at 03:56:03PM +0800, Jisheng Zhang wrote:
> This is to avoid cpufreq update callbacks when we go idle on UP
> platforms.

How so? the patch only avoids calling the update for (!root) cgroups --
which makes sense, but I'm not seeing how that's related to going idle,
or UP at all.

> 
> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> ---
>  kernel/sched/fair.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index bdcbeea..236ec5b 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -3121,7 +3121,8 @@ static inline void update_load_avg(struct sched_entity *se, int not_used)
>  	struct cfs_rq *cfs_rq = cfs_rq_of(se);
>  	struct rq *rq = rq_of(cfs_rq);
>  
> -	cpufreq_trigger_update(rq_clock(rq));
> +	if (&rq->cfs == cfs_rq)
> +		cpufreq_trigger_update(rq_clock(rq));
>  }
>  
>  static inline void
> -- 
> 2.8.1
> 

[toc] | [prev] | [next] | [standalone]


#1431819 — Re: [PATCH] sched/fair: avoid !CONFIG_SMP cpufreq update callbacks when go idle

FromJisheng Zhang <jszhang@marvell.com>
Date2016-06-27 10:50 +0200
SubjectRe: [PATCH] sched/fair: avoid !CONFIG_SMP cpufreq update callbacks when go idle
Message-ID<rOAoV-6gA-3@gated-at.bofh.it>
In reply to#1431815
Dear Peter,

On Mon, 27 Jun 2016 10:37:21 +0200
Peter Zijlstra wrote:

> On Mon, Jun 27, 2016 at 03:56:03PM +0800, Jisheng Zhang wrote:
> > This is to avoid cpufreq update callbacks when we go idle on UP
> > platforms.  
> 
> How so? the patch only avoids calling the update for (!root) cgroups --
> which makes sense, but I'm not seeing how that's related to going idle,
> or UP at all.

oops, I may mis-understand below comment at cfs_rq_util_change()

                 * It will not get called when we go idle, because the idle
                 * thread is a different class (!fair),

I mis-read the comment as:

it's the "&rq->cfs == cfs_rq" check to prevent the calling when go idle.

So the patch still make sense, but I need to update the commit msg?

Thanks,
Jisheng

> 
> > 
> > Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> > ---
> >  kernel/sched/fair.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index bdcbeea..236ec5b 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -3121,7 +3121,8 @@ static inline void update_load_avg(struct sched_entity *se, int not_used)
> >  	struct cfs_rq *cfs_rq = cfs_rq_of(se);
> >  	struct rq *rq = rq_of(cfs_rq);
> >  
> > -	cpufreq_trigger_update(rq_clock(rq));
> > +	if (&rq->cfs == cfs_rq)
> > +		cpufreq_trigger_update(rq_clock(rq));
> >  }
> >  
> >  static inline void
> > -- 
> > 2.8.1
> >   

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web