Skip to content

Commit 10864a9

Browse files
srikardIngo Molnar
authored andcommitted
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: 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]>
1 parent 0ee7e74 commit 10864a9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

kernel/sched/fair.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,14 +1450,12 @@ static unsigned long capacity_of(int cpu);
14501450

14511451
/* Cached statistics for all CPUs within a node */
14521452
struct numa_stats {
1453-
unsigned long nr_running;
14541453
unsigned long load;
14551454

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

1459-
/* Approximate capacity in terms of runnable tasks on a node */
1460-
unsigned long task_capacity;
1458+
unsigned int nr_running;
14611459
int has_free_capacity;
14621460
};
14631461

@@ -1495,9 +1493,9 @@ static void update_numa_stats(struct numa_stats *ns, int nid)
14951493
smt = DIV_ROUND_UP(SCHED_CAPACITY_SCALE * cpus, ns->compute_capacity);
14961494
capacity = cpus / smt; /* cores */
14971495

1498-
ns->task_capacity = min_t(unsigned, capacity,
1496+
capacity = min_t(unsigned, capacity,
14991497
DIV_ROUND_CLOSEST(ns->compute_capacity, SCHED_CAPACITY_SCALE));
1500-
ns->has_free_capacity = (ns->nr_running < ns->task_capacity);
1498+
ns->has_free_capacity = (ns->nr_running < capacity);
15011499
}
15021500

15031501
struct task_numa_env {

0 commit comments

Comments
 (0)