From patchwork Thu Dec 22 15:12:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 88875 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp2856623qgi; Thu, 22 Dec 2016 07:13:12 -0800 (PST) X-Received: by 10.99.114.91 with SMTP id c27mr17685777pgn.163.1482419592312; Thu, 22 Dec 2016 07:13:12 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68si30995812pga.235.2016.12.22.07.13.11; Thu, 22 Dec 2016 07:13:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965625AbcLVPNH (ORCPT + 25 others); Thu, 22 Dec 2016 10:13:07 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:35458 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934904AbcLVPNE (ORCPT ); Thu, 22 Dec 2016 10:13:04 -0500 Received: by mail-wm0-f42.google.com with SMTP id a197so178023749wmd.0 for ; Thu, 22 Dec 2016 07:12:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=I5uY0PD5Cx+F48gNajAElp+HSuShrVRdYWv6AkMwCVU=; b=fc7jKPH7wuTxcnFg4cQkBcy0du+DyBs68X91Awc75w8xO9iS5XBBrvlsjIioVDknl0 aRKhjk07Cq//VhcQiDhTUENjOBpEg1k3MaX1OIRa7a57jVrGnBpyQcQt/swkyt3Dddq/ IP9hjTsqycV64ofKHLf3ydJKLuGf3bqwtVr+c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=I5uY0PD5Cx+F48gNajAElp+HSuShrVRdYWv6AkMwCVU=; b=tpYTDpb9BKpFYAHzIYGfJtrXIwcsOqBX99ehIURi1qnoGglL9UZV8RVYxol6fpefqo Xwv8CBwXbWxNfVOR6lnZTHIl5WLZWABYc55v4OViAGvXqj2RD2iKz9pARHsEsNS5ACh3 RWTEmIfkxJAfC+qudt9I7hCqEuofLGLXiyNVEO2Lew1S5HQzNUwIBL2QViC49sMzIdjN kJSysdtlZ9qyfJFHDpc7p94/6SC4p4N3TE55qKysYLJTur8+Qh0aSsVf/DgvZx9b6M6u N+BhIXWrDCQCGx/Hu0TYbKeRzDVxSy4QfctGP3UsqCWtUb9jRSnzcOFX0pVp0L8MKa76 UpeA== X-Gm-Message-State: AIkVDXLdc+01R4kWDQRPay/RPMEwA7BnHX3ZOTmZk7mCJ8Wr3svJTa0SZwYWccHbW1WE8cZW X-Received: by 10.28.128.198 with SMTP id b189mr11675197wmd.105.1482419537786; Thu, 22 Dec 2016 07:12:17 -0800 (PST) Received: from linaro.org ([2a01:e0a:f:6020:981b:b04a:157c:3d5f]) by smtp.gmail.com with ESMTPSA id j1sm36051475wjm.26.2016.12.22.07.12.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Dec 2016 07:12:16 -0800 (PST) Date: Thu, 22 Dec 2016 16:12:15 +0100 From: Vincent Guittot To: "Huang, Ying" Cc: Stephen Rothwell , Andi Kleen , Tim Chen , Peter Zijlstra , LKP , LKML , Dietmar Eggemann , Dave Hansen , Thomas Gleixner , Linus Torvalds , Ingo Molnar Subject: Re: [LKP] [lkp-developer] [sched/fair] 4e5160766f: +149% ftq.noise.50% regression Message-ID: <20161222151215.GA23448@linaro.org> References: <87zik1ya5g.fsf@yhuang-dev.intel.com> <878trk8urx.fsf@yhuang-dev.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <878trk8urx.fsf@yhuang-dev.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le Tuesday 13 Dec 2016 à 09:47:30 (+0800), Huang, Ying a écrit : > Hi, Vincent, > > Vincent Guittot writes: > > > Hi Ying, > > > > On 12 December 2016 at 06:43, kernel test robot > > wrote: > >> Greeting, > >> > >> FYI, we noticed a 149% regression of ftq.noise.50% due to commit: > >> > >> > >> commit: 4e5160766fcc9f41bbd38bac11f92dce993644aa ("sched/fair: Propagate asynchrous detach") > >> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > >> > >> in testcase: ftq > >> on test machine: 8 threads Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz with 8G memory > >> with following parameters: > >> > >> nr_task: 100% > >> samples: 6000ss > >> test: cache > >> freq: 20 > >> cpufreq_governor: powersave > > > > Why using powersave ? Are you testing every governors ? > > We will test performance and powersave governor for FTQ. Ok thanks > > >> > >> test-description: The FTQ benchmarks measure hardware and software interference or 'noise' on a node from the applications perspective. > >> test-url: https://github.com/rminnich/ftq > > > > It's a bit difficult to understand exactly what is measured and what > > is ftq.noise.50% because this result is not part of the bench which > > seems to only record a log of data in a file and ftq.noise.50% seems > > to be lkp specific > > Yes. FTQ itself has no noise statistics builtin, although it is an OS > noise benchmark. ftq.noise.50% is calculated as below: > > There is a score for every sample of ftq. The lower the score, the > higher the noises. ftq.noise.50% is the number (per 1000000 samples) of > samples whose score is less than 50% of the mean score. > ok so IIUC we have moved from 0.03% to 0.11% for ftq.noise.50% I have not been able to reproduce the regression on the different system that I have access to so I can only guess the root cause of the regression. Could it be possible to test if the patch below fix the regression ? --- kernel/sched/fair.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) -- 2.7.4 Thanks > Best Regards, > Huang, Ying > > > I have tried to reproduce the lkp test on a debian jessie then a > > ubuntu server 16.10 but lkp doesn't seems to install cleanly as there > > are some errors: > > > > sudo bin/lkp run job.yaml > > IPMI BMC is not supported on this machine, skip bmc-watchdog setup! > > 2016-12-12 13:58:39 ./ftq_cache -f 20 -n 6000 -t 8 -a 524288 > > Start 5088418680237 end 5438443372098 elapsed 350024691861 > > cyclestart 14236344834332 cycleend 15214154208877 elapsed 977809374545 > > Avg Cycles(ticks) per ns. is 2.793544; nspercycle is 0.357968 > > Pre-computed ticks per ns: 2.793541 > > Sample frequency is 20.000000 > > ticks per ns 2.79354 > > chown: utilisateur incorrect: «lkp.lkp» > > chown: utilisateur incorrect: «lkp.lkp» > > wait for background monitors: 9405 9407 oom-killer nfs-hang > > curl: (6) Could not resolve host: ftq.time > > > > > >> > >> In addition to that, the commit also has significant impact on the following tests: > >> > >> +------------------+--------------------------------------------------------------------------------+ > >> | testcase: change | unixbench: unixbench.score 2.7% improvement | > >> | test machine | 4 threads Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz with 4G memory | > >> | test parameters | cpufreq_governor=performance | > >> | | nr_task=100% | > >> | | runtime=300s | > >> | | test=execl | > >> +------------------+--------------------------------------------------------------------------------+ > >> > >> > >> Details are as below: > >> --------------------------------------------------------------------------------------------------> > >> > >> > >> To reproduce: > >> > >> git clone git://git.kernel.org/pub/scm/linux/kernel/git/wfg/lkp-tests.git > >> cd lkp-tests > >> bin/lkp install job.yaml # job file is attached in this email > >> bin/lkp run job.yaml > >> > >> testcase/path_params/tbox_group/run: ftq/100%-6000ss-cache-20-powersave/lkp-hsw-d01 > >> > >> 09a43ace1f986b00 4e5160766fcc9f41bbd38bac11 > >> ---------------- -------------------------- > >> %stddev change %stddev > >> \ | \ > >> 305 ± 30% 260% 1100 ± 14% ftq.noise.75% > >> 1386 ± 19% 149% 3457 ± 7% ftq.noise.50% > >> 2148 ± 11% 98% 4257 ± 4% ftq.noise.25% > >> 3963589 3898578 ftq.time.involuntary_context_switches > >> > >> > >> > >> ftq.noise.50_ > >> > >> 4000 ++------------O------------------------------------------------------+ > >> | O O | > >> 3500 ++ O O O O O O O > >> | O O O O O O O O O O O O O O | > >> O O O O O | > >> 3000 ++ O | > >> | O | > >> 2500 ++ | > >> | | > >> 2000 ++ | > >> | * .* | > >> | + : * * * + | > >> 1500 ++ + : + + + + : + .* | > >> |.* *. + * *.. : * + | > >> 1000 *+-------*-----------*----------*------------------------------------+ > >> > >> [*] bisect-good sample > >> [O] bisect-bad sample > >> > >> > >> Disclaimer: > >> Results have been estimated based on internal Intel analysis and are provided > >> for informational purposes only. Any difference in system hardware or software > >> design or configuration may affect actual performance. > >> > >> > >> Thanks, > >> Ying Huang > > _______________________________________________ > > LKP mailing list > > LKP@lists.01.org > > https://lists.01.org/mailman/listinfo/lkp diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 090a9bb..8efa113 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3138,6 +3138,31 @@ static inline int propagate_entity_load_avg(struct sched_entity *se) return 1; } +/* Check if we need to update the load and the utilization of a group_entity */ +static inline bool skip_blocked_update(struct sched_entity *se) +{ + struct cfs_rq *gcfs_rq = group_cfs_rq(se); + + /* + * If sched_entity still have not null load or utilization, we have to + * decay it. + */ + if (se->avg.load_avg || se->avg.util_avg) + return false; + + /* + * If there is a pending propagation, we have to update the load and + * the utilizaion of the sched_entity + */ + if (gcfs_rq->propagate_avg) + return false; + + /* + * Other wise, the load and the utilizaiton of the sched_entity is + * already null so it will be a waste of time to try to decay it + */ + return true; +} #else /* CONFIG_FAIR_GROUP_SCHED */ static inline void update_tg_load_avg(struct cfs_rq *cfs_rq, int force) {} @@ -6858,6 +6883,7 @@ static void update_blocked_averages(int cpu) { struct rq *rq = cpu_rq(cpu); struct cfs_rq *cfs_rq; + struct sched_entity *se; unsigned long flags; raw_spin_lock_irqsave(&rq->lock, flags); @@ -6876,7 +6902,8 @@ static void update_blocked_averages(int cpu) update_tg_load_avg(cfs_rq, 0); /* Propagate pending load changes to the parent */ - if (cfs_rq->tg->se[cpu]) + se = cfs_rq->tg->se[cpu]; + if (se && !skip_blocked_update(se)) update_load_avg(cfs_rq->tg->se[cpu], 0); } raw_spin_unlock_irqrestore(&rq->lock, flags);