[PATCH] sched: add statistic for newidle load balance cost

From: Alex Shi
Date: Tue Jan 21 2014 - 00:28:55 EST


Tracking rq->max_idle_balance_cost and sd->max_newidle_lb_cost
It's useful to track these values in debug mode.

Signed-off-by: Alex Shi <alex.shi@xxxxxxxxxx>
---
kernel/sched/core.c | 7 +++++--
kernel/sched/debug.c | 1 +
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index c3f3824..a046bc3 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4293,7 +4293,7 @@ set_table_entry(struct ctl_table *entry,
static struct ctl_table *
sd_alloc_ctl_domain_table(struct sched_domain *sd)
{
- struct ctl_table *table = sd_alloc_ctl_entry(8);
+ struct ctl_table *table = sd_alloc_ctl_entry(9);

if (table == NULL)
return NULL;
@@ -4313,7 +4313,10 @@ sd_alloc_ctl_domain_table(struct sched_domain *sd)
sizeof(int), 0644, proc_dointvec_minmax);
set_table_entry(&table[6], "name", sd->name,
CORENAME_MAX_SIZE, 0444, proc_dostring);
- /* &table[7] is terminator */
+ set_table_entry(&table[7], "max_newidle_lb_cost",
+ &sd->max_newidle_lb_cost,
+ sizeof(long), 0644, proc_doulongvec_minmax);
+ /* &table[8] is terminator */

return table;
}
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 1e43e70..9ecd861 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -315,6 +315,7 @@ do { \
P(sched_goidle);
#ifdef CONFIG_SMP
P64(avg_idle);
+ P64(max_idle_balance_cost);
#endif

P(ttwu_count);
--
1.8.1.2

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