From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 5/6] xen: RTDS: rearrange members of control structures Date: Fri, 21 Jul 2017 21:51:17 +0200 Message-ID: <1500666677.22958.3.camel@citrix.com> References: <149821475587.5914.12193327340105859241.stgit@Solace> <149821531970.5914.6372373520013365573.stgit@Solace> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2131823110731218450==" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dYdxO-0003l7-5y for xen-devel@lists.xenproject.org; Fri, 21 Jul 2017 19:51:26 +0000 In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Meng Xu Cc: George Dunlap , "xen-devel@lists.xenproject.org" List-Id: xen-devel@lists.xenproject.org --===============2131823110731218450== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-o6LE59yLvLK+l+Tbniq3" --=-o6LE59yLvLK+l+Tbniq3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2017-07-21 at 13:51 -0400, Meng Xu wrote: > On Fri, Jun 23, 2017 at 6:55 AM, Dario Faggioli > wrote: > >=20 > > Nothing changed in `pahole` output, in terms of holes > > and padding, but some fields have been moved, to put > > related members in same cache line. > >=20 > > Signed-off-by: Dario Faggioli > > --- > > Cc: Meng Xu > > Cc: George Dunlap > > --- > > =C2=A0xen/common/sched_rt.c |=C2=A0=C2=A0=C2=A013 ++++++++----- > > =C2=A01 file changed, 8 insertions(+), 5 deletions(-) > >=20 > > diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c > > index 1b30014..39f6bee 100644 > > --- a/xen/common/sched_rt.c > > +++ b/xen/common/sched_rt.c > > @@ -171,11 +171,14 @@ static void repl_timer_handler(void *data); > > =C2=A0struct rt_private { > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0spinlock_t lock;=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* the global coarse-graine= d lock > > */ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct list_head sdom;=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0/* list of availalbe domains, used > > for dump */ > > + > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct list_head runq;=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0/* ordered list of runnable vcpus > > */ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct list_head depletedq; /* unordered = list of depleted > > vcpus */ > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0struct timer *repl_timer;=C2=A0=C2=A0=C2=A0/* = replenishment timer */ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct list_head replq;=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0/* ordered list of vcpus that need > > replenishment */ > > + > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0cpumask_t tickled;=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* cpus been tickled */ > > -=C2=A0=C2=A0=C2=A0=C2=A0struct timer *repl_timer;=C2=A0=C2=A0=C2=A0/* = replenishment timer */ > > =C2=A0}; > >=20 > > =C2=A0/* > > @@ -185,10 +188,6 @@ struct rt_vcpu { > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct list_head q_elem;=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0/* on the runq/depletedq list */ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct list_head replq_elem; /* on the re= plenishment events > > list */ > >=20 > > -=C2=A0=C2=A0=C2=A0=C2=A0/* Up-pointers */ > > -=C2=A0=C2=A0=C2=A0=C2=A0struct rt_dom *sdom; > > -=C2=A0=C2=A0=C2=A0=C2=A0struct vcpu *vcpu; > > - > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* VCPU parameters, in nanoseconds */ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0s_time_t period; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0s_time_t budget; > > @@ -198,6 +197,10 @@ struct rt_vcpu { > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0s_time_t last_start;=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* last start time */ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0s_time_t cur_deadline;=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0/* current deadline for EDF */ > >=20 > > +=C2=A0=C2=A0=C2=A0=C2=A0/* Up-pointers */ > > +=C2=A0=C2=A0=C2=A0=C2=A0struct rt_dom *sdom; > > +=C2=A0=C2=A0=C2=A0=C2=A0struct vcpu *vcpu; > > + > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0unsigned flags;=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* mark __RTDS_= scheduled, etc.. > > */ > > =C2=A0}; > >=20 >=20 > Reviewed-by: Meng Xu >=20 > BTW, Dario, I'm wondering if you used any tool to give hints about > how > to arrange the fields in a structure or you just did it manually? >=20 I used pahole for figuring out the cache layout. But just that. So, basically, I --manually-- tried to move the fields around, and check the result with pahole (and then did it again, and again. :-D). TBH, the improvement for RTDS is probably not even noticeable, as we access almost all the fields anyway. But it still makes sense, IMO. Thanks for the review, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-o6LE59yLvLK+l+Tbniq3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJZcls1AAoJEBZCeImluHPuiGwP/0QSye3c6uVmsXNiumZs6EYs Lz95bJYm85f3vyBkdrSqPnyVrmlApFqwF6frIdfuDQduNz+rDngibXnA2PmA95hy jLqwiUKe9rN9GobSDM7kiIJpXbtj2g97eOTTR5YYKQjA6AB3q7Tz+XiUue9iSDN3 uxKq8A3SIsckzUMowj1uqGq83tygSkP9T/k6nS2/69Ax1n/VD2yVlXoDJ0tk0kgQ dQodhMeqUW0SJqwXss8ZqqIcACRJlvoW6v+Fm1fYQYfoNQJ5rpowJAag0AaiZ/mC t0fddh8O9VCOKF3Ji3oW2/IgDyDA5iZZjUNLdo4fdbdV0pY1D+f2WRGfyZaEq+51 mW32fF8Zet/7yiJRCQWXyTVrnp4PTY4QRkkStqZQtIOJRKDnGdO6KZNyk2buQfqH C6lnFX6gJPDpSzcJtOrHE8VmKo0ViHxUduSSeDJZEDUTmfEJDYnFBbtG3vh6lmFr ffLTl+ZuGYVFGTQbOX040IXg8Ht27lfTe+EqUVC7sXRPDK0aTEfNnB0lFzSmdkCR ikfi2yOBZdsvZsUDizDxnKtXoNbTrrPXEa87uEwmiQTP5d80un4G2A0zgtez6bCC rL8BNh7aMT7lbruAG+KsgzDjc1Fif4f722AAhK2EeQV2qnMbK4Mdah0F6urQ607x 5NRNNhl1UOSlXIVoZe/6 =8kTq -----END PGP SIGNATURE----- --=-o6LE59yLvLK+l+Tbniq3-- --===============2131823110731218450== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============2131823110731218450==--