Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754780AbbLBTzs (ORCPT ); Wed, 2 Dec 2015 14:55:48 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:36203 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754334AbbLBTzr (ORCPT ); Wed, 2 Dec 2015 14:55:47 -0500 From: bsegall@google.com To: Waiman Long Cc: Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org, Yuyang Du , Paul Turner , Morten Rasmussen , Scott J Norton , Douglas Hatch Subject: Re: [PATCH v2 3/3] sched/fair: Disable tg load_avg update for root_task_group References: <1449081710-20185-1-git-send-email-Waiman.Long@hpe.com> <1449081710-20185-4-git-send-email-Waiman.Long@hpe.com> Date: Wed, 02 Dec 2015 11:55:44 -0800 In-Reply-To: <1449081710-20185-4-git-send-email-Waiman.Long@hpe.com> (Waiman Long's message of "Wed, 2 Dec 2015 13:41:50 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1752 Lines: 42 Waiman Long writes: > 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 Reviewed-by: Ben Segall > --- > 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; -- 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/