Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752649AbaG1MBj (ORCPT ); Mon, 28 Jul 2014 08:01:39 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:43870 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751982AbaG1MBi (ORCPT ); Mon, 28 Jul 2014 08:01:38 -0400 Date: Mon, 28 Jul 2014 14:01:25 +0200 From: Peter Zijlstra To: Yuyang Du Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, pjt@google.com, bsegall@google.com, arjan.van.de.ven@intel.com, len.brown@intel.com, rafael.j.wysocki@intel.com, alan.cox@intel.com, mark.gross@intel.com, fengguang.wu@intel.com Subject: Re: [PATCH 2/2 v4] sched: Rewrite per entity runnable load average tracking Message-ID: <20140728120125.GS6758@twins.programming.kicks-ass.net> References: <1405639567-21445-1-git-send-email-yuyang.du@intel.com> <1405639567-21445-3-git-send-email-yuyang.du@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qb+6gLdVH5itmOEb" Content-Disposition: inline In-Reply-To: <1405639567-21445-3-git-send-email-yuyang.du@intel.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --qb+6gLdVH5itmOEb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 18, 2014 at 07:26:06AM +0800, Yuyang Du wrote: > -static void update_cfs_rq_blocked_load(struct cfs_rq *cfs_rq, int force_= update) > +/* Add the load generated by se into cfs_rq's load average */ > +static inline void enqueue_entity_load_avg(struct sched_entity *se) > { > + struct sched_avg *sa =3D &se->avg; > + struct cfs_rq *cfs_rq =3D cfs_rq_of(se); > + u64 now =3D cfs_rq_clock_task(cfs_rq); > + int migrated =3D 0, decayed; > =20 > + if (sa->last_update_time =3D=3D 0) { > + sa->last_update_time =3D now; > =20 > + if (entity_is_task(se)) > + migrated =3D 1; > } > + else > + __update_load_avg(now, sa, se->on_rq * se->load.weight); That's a coding style fail, that should look like: if () { } else { } > =20 > + decayed =3D update_cfs_rq_load_avg(now, cfs_rq); > =20 > + if (migrated) { > + cfs_rq->avg.load_avg +=3D sa->load_avg; > + cfs_rq->avg.load_sum +=3D sa->load_sum; > } > =20 > + if (decayed || migrated) > + update_tg_load_avg(cfs_rq); > } > @@ -2764,7 +2595,7 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_= entity *se, int flags) > * Update run-time statistics of the 'current'. > */ > update_curr(cfs_rq); > - enqueue_entity_load_avg(cfs_rq, se, flags & ENQUEUE_WAKEUP); > + enqueue_entity_load_avg(se); > account_entity_enqueue(cfs_rq, se); > update_cfs_shares(cfs_rq); > =20 Why did you remove the cfs_rq argumetn only to have to re-compute it? --qb+6gLdVH5itmOEb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJT1juVAAoJEHZH4aRLwOS69mAQAK6kbiJYJgGCWLsY/vmP3reG yLWRr6dpSUD5XweU7ib1EizN+9kuMSnMv4JZTNd5kNxskYjDDPFriTV4WruUfXJy 7AyayOqhIPEFb77nFmLRZ1G5vBqhNUxK5TDrafW2AW3zO7szQYJH7vSLAE5HPrh4 LbN8Z34HzKada9na74F2DuYgjfBjPGJi7aAvyz7Xyq5YSDqWvcLn3sIZZSV7mu2a QXkHcMUHF5L8Smm3y+jC1nZEBhoi/q3ugdXt97JE9h4PzHfO8GEiiL84OmPjG5AT pjx/Dhnl+k2g91LRlcFLGh2McmGqx1Th2FsacovLw5vSqJHXnJk38qmIrDKzWgFA F4rZrSZB0lVbzgWWXbsXhgiYv2qjuv+nB5PnU/2CQ02YqLsuYoHVCn+dLq9z0Fry QPN2Y06arnfmEHx9dTgradxwUTTiP7UwXTzH36UOZhbZ08y013A8l7bdKKfDFUoQ 9l1dX4rjKqVmn9LGys/N7ELqw8flFCiCssyMbqvayXRtc0UqicKlayI+5ZvLlNL1 m6CPyaJmjlOY6en8zfSNuGqgFMzfYqUKXZQirgWi/Iqp8eJtIakA1rz5Ty0M7izT XsT/YSyrOjnA7y2iEa9Lff+bMK8Ljq1GtD3Y/4pYvzBM5bMGcUKjSQ20zGQI8XH4 P8dw6LWFAPkPboYdujJi =ObAa -----END PGP SIGNATURE----- --qb+6gLdVH5itmOEb-- -- 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/