From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751081AbbG0EE2 (ORCPT ); Mon, 27 Jul 2015 00:04:28 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:36068 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750927AbbG0EE1 (ORCPT ); Mon, 27 Jul 2015 00:04:27 -0400 Date: Mon, 27 Jul 2015 12:04:20 +0800 From: Boqun Feng To: Yuyang Du Cc: mingo@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org, pjt@google.com, bsegall@google.com, morten.rasmussen@arm.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, umgwanakikbuti@gmail.com, len.brown@intel.com, rafael.j.wysocki@intel.com, arjan@linux.intel.com, fengguang.wu@intel.com Subject: Re: [PATCH v10 6/7] sched: Provide runnable_load_avg back to cfs_rq Message-ID: <20150727040420.GC3328@fixme-laptop.cn.ibm.com> References: <1436918682-4971-1-git-send-email-yuyang.du@intel.com> <1436918682-4971-7-git-send-email-yuyang.du@intel.com> <20150721010346.GA2882@fixme-laptop.cn.ibm.com> <20150721004400.GA28512@intel.com> <20150721101845.GB2882@fixme-laptop.cn.ibm.com> <20150721102956.GA5380@fixme-laptop.cn.ibm.com> <20150726184325.GB28512@intel.com> <20150727032114.GA3328@fixme-laptop.cn.ibm.com> <20150726195634.GE28512@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OwLcNYc0lM97+oe1" Content-Disposition: inline In-Reply-To: <20150726195634.GE28512@intel.com> User-Agent: Mutt/1.5.23+102 (2ca89bed6448) (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --OwLcNYc0lM97+oe1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Yuyang, On Mon, Jul 27, 2015 at 03:56:34AM +0800, Yuyang Du wrote: > On Mon, Jul 27, 2015 at 11:21:15AM +0800, Boqun Feng wrote: > > Hi Yuyang, > >=20 > > On Mon, Jul 27, 2015 at 02:43:25AM +0800, Yuyang Du wrote: > > > Hi Boqun, > > >=20 > > > On Tue, Jul 21, 2015 at 06:29:56PM +0800, Boqun Feng wrote: > > > > The point is that you have already tracked the sum of runnable_load= _avg > > > > and blocked_load_avg in cfs_rq->avg.load_avg. If you're going to tr= ack > > > > part of the sum, you'd better track the one that's updated less > > > > frequently, right? > > > >=20 > > > > Anyway, this idea just comes into my mind. I wonder which is udpated > > > > less frequently myself too. ;-) So I ask to see whether there is > > > > something we can improve. > > >=20 > > > Actually, this is not the point. > > >=20 >=20 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > 1) blocked load is more "difficult" to track, hint, migrate. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=20 I may not get your point here? Are you saying my patch fails to handle the migration or are you just telling me that blocked load tracking need to take migration into consideration? If it's the latter one, I want to say that, with blocked load or not, we have to handle load_avg in migrations, so *adding* some code to handle blocked load is not a big deal. Please consider this piece of code in update_cfs_rq_load_avg(), which decays and updates blocked_load_avg. @@ -2656,6 +2670,12 @@ static inline int update_cfs_rq_load_avg(u64 now, st= ruct cfs_rq *cfs_rq) long r =3D atomic_long_xchg(&cfs_rq->removed_load_avg, 0); sa->load_avg =3D max_t(long, sa->load_avg - r, 0); sa->load_sum =3D max_t(s64, sa->load_sum - r * LOAD_AVG_MAX, 0); + + decay_cfs_rq_blocked_load(sa->last_update_time, cfs_rq); + cfs_rq->blocked_load_avg =3D max_t(long, + cfs_rq->blocked_load_avg - r, 0); + cfs_rq->blocked_load_sum =3D max_t(s64, + cfs_rq->blocked_load_avg - r * LOAD_AVG_MAX, 0); } Regards, Boqun --OwLcNYc0lM97+oe1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJVta3AAAoJEEl56MO1B/q4cj4IAJqzezPO2KSu985ZjhmL5K4g EydsoBVuHekSgqCD0GbgzIOE8Ce9LsE/AFdrwAvfkH8P+DQFHuhAz8IjZiN+CV1p DKOlVIuOBvYDsYwvcJIPzSmE44gdcMB4znnuyPHoBFrM+QFjDte7DNxUyeR/YBoD 5lO5SYhT+j8nX1+I9vXqlWZ0AKrOlkK2KPkM2dy/gwRGcyFnQhIyARvCRSiSfcLJ 1Xw/Iag0jNKRaQG+VzKf4SnJHhhk054cMS6ZZvvm/HYTMXuTMMPtTUthKKdfm4dc 3llC5vd+fWdoxXIvK8TxQdLzl+G2QbaZpQHAWjxyaaObbHx2W/dRPtvgzMUueAU= =GINK -----END PGP SIGNATURE----- --OwLcNYc0lM97+oe1--