Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1411511 > unrolled thread
| Started by | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| First post | 2016-06-01 22:00 +0200 |
| Last post | 2016-06-07 16:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 04/16] sched/fair: Optimize find_idlest_cpu() when there is no choice Peter Zijlstra <peterz@infradead.org> - 2016-06-01 22:00 +0200
Re: [PATCH 04/16] sched/fair: Optimize find_idlest_cpu() when there is no choice Morten Rasmussen <morten.rasmussen@arm.com> - 2016-06-07 16:30 +0200
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2016-06-01 22:00 +0200 |
| Subject | Re: [PATCH 04/16] sched/fair: Optimize find_idlest_cpu() when there is no choice |
| Message-ID | <rFkt3-4lQ-9@gated-at.bofh.it> |
On Mon, May 23, 2016 at 11:58:46AM +0100, Morten Rasmussen wrote:
> In the current find_idlest_group()/find_idlest_cpu() search we end up
> calling find_idlest_cpu() in a sched_group containing only one cpu in
> the end. Checking idle-states becomes pointless when there is no
> alternative, so bail out instead.
>
> cc: Ingo Molnar <mingo@redhat.com>
> cc: Peter Zijlstra <peterz@infradead.org>
>
> Signed-off-by: Morten Rasmussen <morten.rasmussen@arm.com>
> ---
> kernel/sched/fair.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 0fe3020..564215d 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -5155,6 +5155,11 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu)
> int shallowest_idle_cpu = -1;
> int i;
>
> + /* Check if we have any choice */
> + if (group->group_weight == 1) {
> + return cpumask_first(sched_group_cpus(group));
> + }
superfluous brackets, also isn't @this_cpu supposed to be part of the
sched_group_cpu(group) mask?
[toc] | [next] | [standalone]
| From | Morten Rasmussen <morten.rasmussen@arm.com> |
|---|---|
| Date | 2016-06-07 16:30 +0200 |
| Message-ID | <rHqaZ-3ND-3@gated-at.bofh.it> |
| In reply to | #1411511 |
On Wed, Jun 01, 2016 at 09:59:20PM +0200, Peter Zijlstra wrote:
> On Mon, May 23, 2016 at 11:58:46AM +0100, Morten Rasmussen wrote:
> > In the current find_idlest_group()/find_idlest_cpu() search we end up
> > calling find_idlest_cpu() in a sched_group containing only one cpu in
> > the end. Checking idle-states becomes pointless when there is no
> > alternative, so bail out instead.
> >
> > cc: Ingo Molnar <mingo@redhat.com>
> > cc: Peter Zijlstra <peterz@infradead.org>
> >
> > Signed-off-by: Morten Rasmussen <morten.rasmussen@arm.com>
> > ---
> > kernel/sched/fair.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index 0fe3020..564215d 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -5155,6 +5155,11 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu)
> > int shallowest_idle_cpu = -1;
> > int i;
> >
> > + /* Check if we have any choice */
> > + if (group->group_weight == 1) {
> > + return cpumask_first(sched_group_cpus(group));
> > + }
>
> superfluous brackets, also isn't @this_cpu supposed to be part of the
> sched_group_cpu(group) mask?
I'll kill the brackets.
IIUC, @this_cpu is never part of sched_group_cpus(group).
find_idlest_group() never returns the local group, so if we manage to
get to find_idlest_cpu(), the group would not contain @this_cpu.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web