Skip to content

Commit

Permalink
sched/numa: Remove unused task_capacity from 'struct numa_stats'
Browse files Browse the repository at this point in the history
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: Srikar Dronamraju <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Mel Gorman <[email protected]>
Acked-by: Rik van Riel <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
srikard authored and Ingo Molnar committed Jul 25, 2018
1 parent 0ee7e74 commit 10864a9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,14 +1450,12 @@ static unsigned long capacity_of(int cpu);

/* Cached statistics for all CPUs within a node */
struct numa_stats {
unsigned long nr_running;
unsigned long load;

/* Total compute capacity of CPUs on a node */
unsigned long compute_capacity;

/* Approximate capacity in terms of runnable tasks on a node */
unsigned long task_capacity;
unsigned int nr_running;
int has_free_capacity;
};

Expand Down Expand Up @@ -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);
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));
ns->has_free_capacity = (ns->nr_running < ns->task_capacity);
ns->has_free_capacity = (ns->nr_running < capacity);
}

struct task_numa_env {
Expand Down

0 comments on commit 10864a9

Please sign in to comment.