[PATCH 08/19] sched/numa: Remove unused task_capacity from numa_stats

From: Srikar Dronamraju
Date: Mon Jun 04 2018 - 06:01:18 EST


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

No functional changes.

Signed-off-by: Srikar Dronamraju <srikar@xxxxxxxxxxxxxxxxxx>
---
kernel/sched/fair.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index d4bf973..35c4a75 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1411,14 +1411,12 @@ bool should_numa_migrate_memory(struct task_struct *p, struct page * page,

/* 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;
};

@@ -1456,9 +1454,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 {
--
1.8.3.1