From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755361AbbGVCUC (ORCPT ); Tue, 21 Jul 2015 22:20:02 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:35170 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754336AbbGVCUB (ORCPT ); Tue, 21 Jul 2015 22:20:01 -0400 Date: Wed, 22 Jul 2015 10:19:54 +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: <20150722021954.GC2882@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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jq0ap7NbKX2Kqbes" Content-Disposition: inline In-Reply-To: <1436918682-4971-7-git-send-email-yuyang.du@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 --jq0ap7NbKX2Kqbes Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 15, 2015 at 08:04:41AM +0800, Yuyang Du wrote: > The cfs_rq's load_avg is composed of runnable_load_avg and blocked_load_a= vg. > Before this series, sometimes the runnable_load_avg is used, and sometimes > the load_avg is used. Completely replacing all uses of runnable_load_avg > with load_avg may be too big a leap, i.e., the blocked_load_avg is concer= ned > to result in overrated load. Therefore, we get runnable_load_avg back. >=20 > The new cfs_rq's runnable_load_avg is improved to be updated with all of = the > runnable sched_eneities at the same time, so the one sched_entity updated= and > the others stale problem is solved. >=20 > Signed-off-by: Yuyang Du > --- > +/* Remove the runnable load generated by se from cfs_rq's runnable load = average */ > +static inline void > +dequeue_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) > +{ > + update_load_avg(se, 1); > + I think we need an update_cfs_rq_load_avg() here? Because the runnable_load_avg may not be up to date when dequeue_entity_load_avg() is called, right? > + cfs_rq->runnable_load_avg =3D > + max_t(long, cfs_rq->runnable_load_avg - se->avg.load_avg, 0); > + cfs_rq->runnable_load_sum =3D > + max_t(s64, cfs_rq->runnable_load_sum - se->avg.load_sum, 0); > +} > + > /* > * Task first catches up with cfs_rq, and then subtract > * itself from the cfs_rq (task must be off the queue now). > @@ -2982,7 +3015,7 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_= entity *se, int flags) > * Update run-time statistics of the 'current'. > */ > update_curr(cfs_rq); > - update_load_avg(se, 1); > + dequeue_entity_load_avg(cfs_rq, se); > =20 > update_stats_dequeue(cfs_rq, se); > if (flags & DEQUEUE_SLEEP) { Thanks and Best Regards, Boqun --jq0ap7NbKX2Kqbes Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJVrv3CAAoJEEl56MO1B/q4g1AH/1dcoqNfZXdd3H1BAmuu6kZJ pufHrroub8MVvHLYBQsfddtwN4ggj033ffpSedVsxbvolHs345BvuLrYdvxN36Xp 24IR92AVTl1Yw2KQp1Q3FG+ktm1cVyrpQOAOvMA3h5Xrb2fh0vwSx3pTg1SGFIo1 oLvJceRPgGOZy95DBeMBNIupw8lzJs5mEhd6ukPs2OG+exA8h3ciyUnTFuz5u8Fm mh1T+fHkVYrKnJLrctgzc9AxmUEXK3w5y7NmHMMMClp4rna++51jcNYoCxCxoGxx xkYShdfUQ5ZfZU6+Gt603VJzz4CWgnDSlTcfqRcgQn9lUhBqEwVeS70d++UUAM8= =WVaa -----END PGP SIGNATURE----- --jq0ap7NbKX2Kqbes--