Re: [PATCH v2 1/6] sched/fair.c: remove "power" from struct numa_stats

2014-05-26 Thread Mike Galbraith
On Mon, 2014-05-26 at 23:18 -0400, Nicolas Pitre wrote: 
> On Tue, 27 May 2014, Mike Galbraith wrote:
> 
> > On Mon, 2014-05-26 at 18:19 -0400, Nicolas Pitre wrote: 
> > > 
> > > @@ -1046,7 +1046,7 @@ static void update_numa_stats(struct numa_stats 
> > > *ns, int nid)
> > >  
> > >   ns->nr_running += rq->nr_running;
> > >   ns->load += weighted_cpuload(cpu);
> > > - ns->power += power_of(cpu);
> > > + ns->compute_capacity += power_of(cpu);
> > 
> > power_of(cpu) as a capacity input looks odd now.. 
> > 
> > > @@ -1062,9 +1062,10 @@ static void update_numa_stats(struct numa_stats 
> > > *ns, int nid)
> > >   if (!cpus)
> > >   return;
> > >  
> > > - ns->load = (ns->load * SCHED_POWER_SCALE) / ns->power;
> > > - ns->capacity = DIV_ROUND_CLOSEST(ns->power, SCHED_POWER_SCALE);
> > > - ns->has_capacity = (ns->nr_running < ns->capacity);
> > > + ns->load = (ns->load * SCHED_POWER_SCALE) / ns->compute_capacity;
> > > + ns->task_capacity =
> > > + DIV_ROUND_CLOSEST(ns->compute_capacity, SCHED_POWER_SCALE);
> > 
> > ..as do SCHED_POWER_SCALE, update_cpu_power() etc.
> 
> The rest is renamed in a later patch.  I wanted to split it into 
> multiple patches to keep those changes manageable.

I don't see a lot of benefit in creating intermediate inconsistencies vs
one bulk rename, but it does make smaller patches, so never mind.

-Mike

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 1/6] sched/fair.c: remove "power" from struct numa_stats

2014-05-26 Thread Nicolas Pitre
On Tue, 27 May 2014, Mike Galbraith wrote:

> On Mon, 2014-05-26 at 18:19 -0400, Nicolas Pitre wrote: 
> > 
> > @@ -1046,7 +1046,7 @@ static void update_numa_stats(struct numa_stats *ns, 
> > int nid)
> >  
> > ns->nr_running += rq->nr_running;
> > ns->load += weighted_cpuload(cpu);
> > -   ns->power += power_of(cpu);
> > +   ns->compute_capacity += power_of(cpu);
> 
> power_of(cpu) as a capacity input looks odd now.. 
> 
> > @@ -1062,9 +1062,10 @@ static void update_numa_stats(struct numa_stats *ns, 
> > int nid)
> > if (!cpus)
> > return;
> >  
> > -   ns->load = (ns->load * SCHED_POWER_SCALE) / ns->power;
> > -   ns->capacity = DIV_ROUND_CLOSEST(ns->power, SCHED_POWER_SCALE);
> > -   ns->has_capacity = (ns->nr_running < ns->capacity);
> > +   ns->load = (ns->load * SCHED_POWER_SCALE) / ns->compute_capacity;
> > +   ns->task_capacity =
> > +   DIV_ROUND_CLOSEST(ns->compute_capacity, SCHED_POWER_SCALE);
> 
> ..as do SCHED_POWER_SCALE, update_cpu_power() etc.

The rest is renamed in a later patch.  I wanted to split it into 
multiple patches to keep those changes manageable.


Nicolas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 1/6] sched/fair.c: remove "power" from struct numa_stats

2014-05-26 Thread Mike Galbraith
On Mon, 2014-05-26 at 18:19 -0400, Nicolas Pitre wrote: 
> 
> @@ -1046,7 +1046,7 @@ static void update_numa_stats(struct numa_stats *ns, 
> int nid)
>  
>   ns->nr_running += rq->nr_running;
>   ns->load += weighted_cpuload(cpu);
> - ns->power += power_of(cpu);
> + ns->compute_capacity += power_of(cpu);

power_of(cpu) as a capacity input looks odd now.. 

> @@ -1062,9 +1062,10 @@ static void update_numa_stats(struct numa_stats *ns, 
> int nid)
>   if (!cpus)
>   return;
>  
> - ns->load = (ns->load * SCHED_POWER_SCALE) / ns->power;
> - ns->capacity = DIV_ROUND_CLOSEST(ns->power, SCHED_POWER_SCALE);
> - ns->has_capacity = (ns->nr_running < ns->capacity);
> + ns->load = (ns->load * SCHED_POWER_SCALE) / ns->compute_capacity;
> + ns->task_capacity =
> + DIV_ROUND_CLOSEST(ns->compute_capacity, SCHED_POWER_SCALE);

..as do SCHED_POWER_SCALE, update_cpu_power() etc.

-Mike

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 1/6] sched/fair.c: remove "power" from struct numa_stats

2014-05-26 Thread Nicolas Pitre
It is better not to think about compute capacity as being equivalent
to "CPU power".  The upcoming "power aware" scheduler work may create
confusion with the notion of energy consumption if "power" is used too
liberally.

To make things explicit and not create more confusion with the existing
"capacity" member, let's rename things as follows:

power-> compute_capacity
capacity -> task_capacity

Note: none of those fields are actually used outside update_numa_stats().

Signed-off-by: Nicolas Pitre 
---
 kernel/sched/fair.c | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c9617b73bc..16f0dddb70 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1026,10 +1026,10 @@ struct numa_stats {
unsigned long load;
 
/* Total compute capacity of CPUs on a node */
-   unsigned long power;
+   unsigned long compute_capacity;
 
/* Approximate capacity in terms of runnable tasks on a node */
-   unsigned long capacity;
+   unsigned long task_capacity;
int has_capacity;
 };
 
@@ -1046,7 +1046,7 @@ static void update_numa_stats(struct numa_stats *ns, int 
nid)
 
ns->nr_running += rq->nr_running;
ns->load += weighted_cpuload(cpu);
-   ns->power += power_of(cpu);
+   ns->compute_capacity += power_of(cpu);
 
cpus++;
}
@@ -1062,9 +1062,10 @@ static void update_numa_stats(struct numa_stats *ns, int 
nid)
if (!cpus)
return;
 
-   ns->load = (ns->load * SCHED_POWER_SCALE) / ns->power;
-   ns->capacity = DIV_ROUND_CLOSEST(ns->power, SCHED_POWER_SCALE);
-   ns->has_capacity = (ns->nr_running < ns->capacity);
+   ns->load = (ns->load * SCHED_POWER_SCALE) / ns->compute_capacity;
+   ns->task_capacity =
+   DIV_ROUND_CLOSEST(ns->compute_capacity, SCHED_POWER_SCALE);
+   ns->has_capacity = (ns->nr_running < ns->task_capacity);
 }
 
 struct task_numa_env {
-- 
1.8.4.108.g55ea5f6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 1/6] sched/fair.c: remove power from struct numa_stats

2014-05-26 Thread Nicolas Pitre
It is better not to think about compute capacity as being equivalent
to CPU power.  The upcoming power aware scheduler work may create
confusion with the notion of energy consumption if power is used too
liberally.

To make things explicit and not create more confusion with the existing
capacity member, let's rename things as follows:

power- compute_capacity
capacity - task_capacity

Note: none of those fields are actually used outside update_numa_stats().

Signed-off-by: Nicolas Pitre n...@linaro.org
---
 kernel/sched/fair.c | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c9617b73bc..16f0dddb70 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1026,10 +1026,10 @@ struct numa_stats {
unsigned long load;
 
/* Total compute capacity of CPUs on a node */
-   unsigned long power;
+   unsigned long compute_capacity;
 
/* Approximate capacity in terms of runnable tasks on a node */
-   unsigned long capacity;
+   unsigned long task_capacity;
int has_capacity;
 };
 
@@ -1046,7 +1046,7 @@ static void update_numa_stats(struct numa_stats *ns, int 
nid)
 
ns-nr_running += rq-nr_running;
ns-load += weighted_cpuload(cpu);
-   ns-power += power_of(cpu);
+   ns-compute_capacity += power_of(cpu);
 
cpus++;
}
@@ -1062,9 +1062,10 @@ static void update_numa_stats(struct numa_stats *ns, int 
nid)
if (!cpus)
return;
 
-   ns-load = (ns-load * SCHED_POWER_SCALE) / ns-power;
-   ns-capacity = DIV_ROUND_CLOSEST(ns-power, SCHED_POWER_SCALE);
-   ns-has_capacity = (ns-nr_running  ns-capacity);
+   ns-load = (ns-load * SCHED_POWER_SCALE) / ns-compute_capacity;
+   ns-task_capacity =
+   DIV_ROUND_CLOSEST(ns-compute_capacity, SCHED_POWER_SCALE);
+   ns-has_capacity = (ns-nr_running  ns-task_capacity);
 }
 
 struct task_numa_env {
-- 
1.8.4.108.g55ea5f6

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 1/6] sched/fair.c: remove power from struct numa_stats

2014-05-26 Thread Mike Galbraith
On Mon, 2014-05-26 at 18:19 -0400, Nicolas Pitre wrote: 
 
 @@ -1046,7 +1046,7 @@ static void update_numa_stats(struct numa_stats *ns, 
 int nid)
  
   ns-nr_running += rq-nr_running;
   ns-load += weighted_cpuload(cpu);
 - ns-power += power_of(cpu);
 + ns-compute_capacity += power_of(cpu);

power_of(cpu) as a capacity input looks odd now.. 

 @@ -1062,9 +1062,10 @@ static void update_numa_stats(struct numa_stats *ns, 
 int nid)
   if (!cpus)
   return;
  
 - ns-load = (ns-load * SCHED_POWER_SCALE) / ns-power;
 - ns-capacity = DIV_ROUND_CLOSEST(ns-power, SCHED_POWER_SCALE);
 - ns-has_capacity = (ns-nr_running  ns-capacity);
 + ns-load = (ns-load * SCHED_POWER_SCALE) / ns-compute_capacity;
 + ns-task_capacity =
 + DIV_ROUND_CLOSEST(ns-compute_capacity, SCHED_POWER_SCALE);

..as do SCHED_POWER_SCALE, update_cpu_power() etc.

-Mike

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 1/6] sched/fair.c: remove power from struct numa_stats

2014-05-26 Thread Nicolas Pitre
On Tue, 27 May 2014, Mike Galbraith wrote:

 On Mon, 2014-05-26 at 18:19 -0400, Nicolas Pitre wrote: 
  
  @@ -1046,7 +1046,7 @@ static void update_numa_stats(struct numa_stats *ns, 
  int nid)
   
  ns-nr_running += rq-nr_running;
  ns-load += weighted_cpuload(cpu);
  -   ns-power += power_of(cpu);
  +   ns-compute_capacity += power_of(cpu);
 
 power_of(cpu) as a capacity input looks odd now.. 
 
  @@ -1062,9 +1062,10 @@ static void update_numa_stats(struct numa_stats *ns, 
  int nid)
  if (!cpus)
  return;
   
  -   ns-load = (ns-load * SCHED_POWER_SCALE) / ns-power;
  -   ns-capacity = DIV_ROUND_CLOSEST(ns-power, SCHED_POWER_SCALE);
  -   ns-has_capacity = (ns-nr_running  ns-capacity);
  +   ns-load = (ns-load * SCHED_POWER_SCALE) / ns-compute_capacity;
  +   ns-task_capacity =
  +   DIV_ROUND_CLOSEST(ns-compute_capacity, SCHED_POWER_SCALE);
 
 ..as do SCHED_POWER_SCALE, update_cpu_power() etc.

The rest is renamed in a later patch.  I wanted to split it into 
multiple patches to keep those changes manageable.


Nicolas
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 1/6] sched/fair.c: remove power from struct numa_stats

2014-05-26 Thread Mike Galbraith
On Mon, 2014-05-26 at 23:18 -0400, Nicolas Pitre wrote: 
 On Tue, 27 May 2014, Mike Galbraith wrote:
 
  On Mon, 2014-05-26 at 18:19 -0400, Nicolas Pitre wrote: 
   
   @@ -1046,7 +1046,7 @@ static void update_numa_stats(struct numa_stats 
   *ns, int nid)

 ns-nr_running += rq-nr_running;
 ns-load += weighted_cpuload(cpu);
   - ns-power += power_of(cpu);
   + ns-compute_capacity += power_of(cpu);
  
  power_of(cpu) as a capacity input looks odd now.. 
  
   @@ -1062,9 +1062,10 @@ static void update_numa_stats(struct numa_stats 
   *ns, int nid)
 if (!cpus)
 return;

   - ns-load = (ns-load * SCHED_POWER_SCALE) / ns-power;
   - ns-capacity = DIV_ROUND_CLOSEST(ns-power, SCHED_POWER_SCALE);
   - ns-has_capacity = (ns-nr_running  ns-capacity);
   + ns-load = (ns-load * SCHED_POWER_SCALE) / ns-compute_capacity;
   + ns-task_capacity =
   + DIV_ROUND_CLOSEST(ns-compute_capacity, SCHED_POWER_SCALE);
  
  ..as do SCHED_POWER_SCALE, update_cpu_power() etc.
 
 The rest is renamed in a later patch.  I wanted to split it into 
 multiple patches to keep those changes manageable.

I don't see a lot of benefit in creating intermediate inconsistencies vs
one bulk rename, but it does make smaller patches, so never mind.

-Mike

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/