Commit 10864a9e authored by Srikar Dronamraju's avatar Srikar Dronamraju Committed by Ingo Molnar

sched/numa: Remove unused task_capacity from 'struct numa_stats'

The task_capacity field in 'struct numa_stats' is redundant.
Also move nr_running for better packing within the struct.

No functional changes.

Running SPECjbb2005 on a 4 node machine and comparing bops/JVM
JVMS  LAST_PATCH  WITH_PATCH  %CHANGE
16    25308.6     25377.3     0.271
1     72964       72287       -0.92
Signed-off-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: default avatarMel Gorman <mgorman@techsingularity.net>
Acked-by: default avatarRik van Riel <riel@surriel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1529514181-9842-9-git-send-email-srikar@linux.vnet.ibm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 0ee7e74d
...@@ -1450,14 +1450,12 @@ static unsigned long capacity_of(int cpu); ...@@ -1450,14 +1450,12 @@ static unsigned long capacity_of(int cpu);
/* Cached statistics for all CPUs within a node */ /* Cached statistics for all CPUs within a node */
struct numa_stats { struct numa_stats {
unsigned long nr_running;
unsigned long load; unsigned long load;
/* Total compute capacity of CPUs on a node */ /* Total compute capacity of CPUs on a node */
unsigned long compute_capacity; unsigned long compute_capacity;
/* Approximate capacity in terms of runnable tasks on a node */ unsigned int nr_running;
unsigned long task_capacity;
int has_free_capacity; int has_free_capacity;
}; };
...@@ -1495,9 +1493,9 @@ static void update_numa_stats(struct numa_stats *ns, int nid) ...@@ -1495,9 +1493,9 @@ static void update_numa_stats(struct numa_stats *ns, int nid)
smt = DIV_ROUND_UP(SCHED_CAPACITY_SCALE * cpus, ns->compute_capacity); smt = DIV_ROUND_UP(SCHED_CAPACITY_SCALE * cpus, ns->compute_capacity);
capacity = cpus / smt; /* cores */ capacity = cpus / smt; /* cores */
ns->task_capacity = min_t(unsigned, capacity, capacity = min_t(unsigned, capacity,
DIV_ROUND_CLOSEST(ns->compute_capacity, SCHED_CAPACITY_SCALE)); DIV_ROUND_CLOSEST(ns->compute_capacity, SCHED_CAPACITY_SCALE));
ns->has_free_capacity = (ns->nr_running < ns->task_capacity); ns->has_free_capacity = (ns->nr_running < capacity);
} }
struct task_numa_env { struct task_numa_env {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment