Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756226AbbLDL6v (ORCPT ); Fri, 4 Dec 2015 06:58:51 -0500 Received: from terminus.zytor.com ([198.137.202.10]:60296 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755678AbbLDL6t (ORCPT ); Fri, 4 Dec 2015 06:58:49 -0500 Date: Fri, 4 Dec 2015 03:58:01 -0800 From: tip-bot for Waiman Long Message-ID: Cc: mingo@kernel.org, peterz@infradead.org, hpa@zytor.com, efault@gmx.de, torvalds@linux-foundation.org, yuyang.du@intel.com, pjt@google.com, linux-kernel@vger.kernel.org, morten.rasmussen@arm.com, doug.hatch@hpe.com, bsegall@google.com, tglx@linutronix.de, scott.norton@hpe.com, Waiman.Long@hpe.com Reply-To: morten.rasmussen@arm.com, doug.hatch@hpe.com, pjt@google.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, Waiman.Long@hpe.com, scott.norton@hpe.com, bsegall@google.com, peterz@infradead.org, mingo@kernel.org, yuyang.du@intel.com, efault@gmx.de, hpa@zytor.com, torvalds@linux-foundation.org In-Reply-To: <1449081710-20185-4-git-send-email-Waiman.Long@hpe.com> References: <1449081710-20185-4-git-send-email-Waiman.Long@hpe.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/fair: Disable the task group load_avg update for the root_task_group Git-Commit-ID: aa0b7ae06387d40a988ce16a189082dee6e570bc X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2568 Lines: 60 Commit-ID: aa0b7ae06387d40a988ce16a189082dee6e570bc Gitweb: http://git.kernel.org/tip/aa0b7ae06387d40a988ce16a189082dee6e570bc Author: Waiman Long AuthorDate: Wed, 2 Dec 2015 13:41:50 -0500 Committer: Ingo Molnar CommitDate: Fri, 4 Dec 2015 10:34:49 +0100 sched/fair: Disable the task group load_avg update for the root_task_group 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 Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Ben Segall Cc: Douglas Hatch Cc: Linus Torvalds Cc: Mike Galbraith Cc: Morten Rasmussen Cc: Paul Turner Cc: Peter Zijlstra Cc: Scott J Norton Cc: Thomas Gleixner Cc: Yuyang Du Link: http://lkml.kernel.org/r/1449081710-20185-4-git-send-email-Waiman.Long@hpe.com Signed-off-by: Ingo Molnar --- kernel/sched/fair.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 4b0e8b8..1093873 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2709,6 +2709,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; -- 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/