From: Dario Faggioli <dario.faggioli@citrix.com>
To: Meng Xu <mengxu@cis.upenn.edu>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 5/6] xen: RTDS: rearrange members of control structures
Date: Fri, 21 Jul 2017 21:51:17 +0200 [thread overview]
Message-ID: <1500666677.22958.3.camel@citrix.com> (raw)
In-Reply-To: <CAENZ-+=5o7RQdK5s_79xb1Uxkq0DCHeqWtL6CPQ8hdGHY1+f3w@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 3319 bytes --]
On Fri, 2017-07-21 at 13:51 -0400, Meng Xu wrote:
> On Fri, Jun 23, 2017 at 6:55 AM, Dario Faggioli
> <dario.faggioli@citrix.com> wrote:
> >
> > 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.
> >
> > Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
> > ---
> > Cc: Meng Xu <mengxu@cis.upenn.edu>
> > Cc: George Dunlap <george.dunlap@eu.citrix.com>
> > ---
> > xen/common/sched_rt.c | 13 ++++++++-----
> > 1 file changed, 8 insertions(+), 5 deletions(-)
> >
> > 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);
> > struct rt_private {
> > spinlock_t lock; /* the global coarse-grained lock
> > */
> > struct list_head sdom; /* list of availalbe domains, used
> > for dump */
> > +
> > struct list_head runq; /* ordered list of runnable vcpus
> > */
> > struct list_head depletedq; /* unordered list of depleted
> > vcpus */
> > +
> > + struct timer *repl_timer; /* replenishment timer */
> > struct list_head replq; /* ordered list of vcpus that need
> > replenishment */
> > +
> > cpumask_t tickled; /* cpus been tickled */
> > - struct timer *repl_timer; /* replenishment timer */
> > };
> >
> > /*
> > @@ -185,10 +188,6 @@ struct rt_vcpu {
> > struct list_head q_elem; /* on the runq/depletedq list */
> > struct list_head replq_elem; /* on the replenishment events
> > list */
> >
> > - /* Up-pointers */
> > - struct rt_dom *sdom;
> > - struct vcpu *vcpu;
> > -
> > /* VCPU parameters, in nanoseconds */
> > s_time_t period;
> > s_time_t budget;
> > @@ -198,6 +197,10 @@ struct rt_vcpu {
> > s_time_t last_start; /* last start time */
> > s_time_t cur_deadline; /* current deadline for EDF */
> >
> > + /* Up-pointers */
> > + struct rt_dom *sdom;
> > + struct vcpu *vcpu;
> > +
> > unsigned flags; /* mark __RTDS_scheduled, etc..
> > */
> > };
> >
>
> Reviewed-by: Meng Xu <mengxu@cis.upenn.edu>
>
> 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?
>
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
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 127 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-07-21 19:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-23 10:54 [PATCH 0/6] xen: sched: control structure memory layout optimizations Dario Faggioli
2017-06-23 10:54 ` [PATCH 1/6] xen: credit2: allocate runqueue data structure dynamically Dario Faggioli
2017-07-21 16:50 ` George Dunlap
2017-06-23 10:54 ` [PATCH 2/6] xen: credit2: make the cpu to runqueue map per-cpu Dario Faggioli
2017-07-21 16:56 ` George Dunlap
2017-06-23 10:55 ` [PATCH 3/6] xen: credit: rearrange members of control structures Dario Faggioli
2017-07-21 17:02 ` George Dunlap
2017-06-23 10:55 ` [PATCH 4/6] xen: credit2: " Dario Faggioli
2017-07-21 17:05 ` George Dunlap
2017-07-21 19:53 ` Dario Faggioli
2017-06-23 10:55 ` [PATCH 5/6] xen: RTDS: " Dario Faggioli
2017-07-21 17:06 ` George Dunlap
2017-07-21 17:51 ` Meng Xu
2017-07-21 19:51 ` Dario Faggioli [this message]
2017-06-23 10:55 ` [PATCH 6/6] xen: sched: optimize exclusive pinning case (Credit1 & 2) Dario Faggioli
2017-07-21 17:19 ` George Dunlap
2017-07-21 19:55 ` Dario Faggioli
2017-07-21 20:30 ` George Dunlap
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1500666677.22958.3.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=mengxu@cis.upenn.edu \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).