Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1282267

[PATCH v2 3/3] sched/fair: Disable tg load_avg update for root_task_group

From Waiman Long <Waiman.Long@hpe.com>
Newsgroups linux.kernel
Subject [PATCH v2 3/3] sched/fair: Disable tg load_avg update for root_task_group
Date 2015-12-02 19:50 +0100
Message-ID <qBkDw-2x9-15@gated-at.bofh.it> (permalink)
References <qBkDv-2x9-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Currently, the update_tg_load_avg() function attempts to update the
tg's load_avg value whenever the load changes even for root_task_group
where the load_avg value will never be used. This patch will disable
the load_avg update when the given task group is the root_task_group.

Running a Java benchmark with noautogroup and a 4.3 kernel on a
16-socket IvyBridge-EX system, the amount of CPU time (as reported by
perf) consumed by task_tick_fair() which includes update_tg_load_avg()
decreased from 0.71% to 0.22%, a more than 3X reduction. The Max-jOPs
results also increased slightly from 983015 to 986449.

Signed-off-by: Waiman Long <Waiman.Long@hpe.com>
---
 kernel/sched/fair.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 8f1eccc..4607cb7 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2670,6 +2670,12 @@ static inline void update_tg_load_avg(struct cfs_rq *cfs_rq, int force)
 {
 	long delta = cfs_rq->avg.load_avg - cfs_rq->tg_load_avg_contrib;
 
+	/*
+	 * No need to update load_avg for root_task_group as it is not used.
+	 */
+	if (cfs_rq->tg == &root_task_group)
+		return;
+
 	if (force || abs(delta) > cfs_rq->tg_load_avg_contrib / 64) {
 		atomic_long_add(delta, &cfs_rq->tg->load_avg);
 		cfs_rq->tg_load_avg_contrib = cfs_rq->avg.load_avg;
-- 
1.7.1

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/3] sched/fair: Reduce contention on tg's load_avg Waiman Long <Waiman.Long@hpe.com> - 2015-12-02 19:50 +0100
  [PATCH v2 1/3] sched/fair: Avoid redundant idle_cpu() call in update_sg_lb_stats() Waiman Long <Waiman.Long@hpe.com> - 2015-12-02 19:50 +0100
  [PATCH v2 3/3] sched/fair: Disable tg load_avg update for root_task_group Waiman Long <Waiman.Long@hpe.com> - 2015-12-02 19:50 +0100
    Re: [PATCH v2 3/3] sched/fair: Disable tg load_avg update for root_task_group bsegall@google.com - 2015-12-02 21:00 +0100
    [tip:sched/core] sched/fair:   Disable the task group load_avg update for the root_task_group tip-bot for Waiman Long <tipbot@zytor.com> - 2015-12-04 13:00 +0100
  [PATCH v2 2/3] sched/fair: Move hot load_avg into its own cacheline Waiman Long <Waiman.Long@hpe.com> - 2015-12-02 19:50 +0100
    Re: [PATCH v2 2/3] sched/fair: Move hot load_avg into its own cacheline bsegall@google.com - 2015-12-02 21:10 +0100
      Re: [PATCH v2 2/3] sched/fair: Move hot load_avg into its own cacheline Waiman Long <waiman.long@hpe.com> - 2015-12-03 20:30 +0100
        Re: [PATCH v2 2/3] sched/fair: Move hot load_avg into its own cacheline bsegall@google.com - 2015-12-03 20:50 +0100
    Re: [PATCH v2 2/3] sched/fair: Move hot load_avg into its own  cacheline Mike Galbraith <umgwanakikbuti@gmail.com> - 2015-12-03 05:40 +0100
      Re: [PATCH v2 2/3] sched/fair: Move hot load_avg into its own cacheline Waiman Long <waiman.long@hpe.com> - 2015-12-03 20:40 +0100
        Re: [PATCH v2 2/3] sched/fair: Move hot load_avg into its own  cacheline Mike Galbraith <umgwanakikbuti@gmail.com> - 2015-12-04 03:10 +0100
          Re: [PATCH v2 2/3] sched/fair: Move hot load_avg into its own cacheline Waiman Long <waiman.long@hpe.com> - 2015-12-04 21:20 +0100
    Re: [PATCH v2 2/3] sched/fair: Move hot load_avg into its own  cacheline Peter Zijlstra <peterz@infradead.org> - 2015-12-03 12:00 +0100
      Re: [PATCH v2 2/3] sched/fair: Move hot load_avg into its own cacheline Waiman Long <waiman.long@hpe.com> - 2015-12-03 20:40 +0100
    Re: [PATCH v2 2/3] sched/fair: Move hot load_avg into its own  cacheline Peter Zijlstra <peterz@infradead.org> - 2015-12-03 12:20 +0100
      Re: [PATCH v2 2/3] sched/fair: Move hot load_avg into its own cacheline bsegall@google.com - 2015-12-03 19:10 +0100
        Re: [PATCH v2 2/3] sched/fair: Move hot load_avg into its own  cacheline Peter Zijlstra <peterz@infradead.org> - 2015-12-03 19:20 +0100
          Re: [PATCH v2 2/3] sched/fair: Move hot load_avg into its own cacheline bsegall@google.com - 2015-12-03 19:30 +0100
      Re: [PATCH v2 2/3] sched/fair: Move hot load_avg into its own cacheline Waiman Long <waiman.long@hpe.com> - 2015-12-03 21:00 +0100
        Re: [PATCH v2 2/3] sched/fair: Move hot load_avg into its own  cacheline Peter Zijlstra <peterz@infradead.org> - 2015-12-03 21:10 +0100
    [tip:sched/core] sched/fair: Move the cache-hot 'load_avg'   variable into its own cacheline tip-bot for Waiman Long <tipbot@zytor.com> - 2015-12-04 13:00 +0100

csiph-web