From: Dario Faggioli <dario.faggioli@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Cc: henric@hawaii.edu, "Justin T. Weaver" <jtweaver@hawaii.edu>,
xen-devel@lists.xen.org
Subject: Re: [PATCH v3 1/4] sched: credit2: respect per-vcpu hard affinity
Date: Thu, 23 Apr 2015 18:00:21 +0200 [thread overview]
Message-ID: <1429804821.18926.199.camel@citrix.com> (raw)
In-Reply-To: <551AB128.8090905@eu.citrix.com>
[-- Attachment #1.1: Type: text/plain, Size: 2955 bytes --]
On Tue, 2015-03-31 at 15:37 +0100, George Dunlap wrote:
> On 03/26/2015 09:48 AM, Justin T. Weaver wrote:
> > --- a/xen/common/sched_credit2.c
> > +++ b/xen/common/sched_credit2.c
> > @@ -194,6 +195,12 @@ int opt_overload_balance_tolerance=-3;
> > integer_param("credit2_balance_over", opt_overload_balance_tolerance);
> >
> > /*
> > + * Use this to avoid having too many cpumask_t structs on the stack
> > + */
> > +static cpumask_t **scratch_mask = NULL;
> > +#define csched2_cpumask scratch_mask[smp_processor_id()]
>
> Since I'm asking for changes below: It's not clear to me when I'm
> scanning the code that csched2_cpumask is a scratch variable. What
> about calling the actual variable _scratch_cpumask and havind the
> #define be scratch_cpumask?
>
+1
> > /* Find the runqueue with the lowest instantaneous load */
> > for_each_cpu(i, &prv->active_queues)
> > {
> > struct csched2_runqueue_data *rqd;
> > - s_time_t rqd_avgload;
> > + s_time_t rqd_avgload = MAX_LOAD;
> >
> > rqd = prv->rqd + i;
> >
> > /* If checking a different runqueue, grab the lock,
> > - * read the avg, and then release the lock.
> > + * check hard affinity, read the avg, and then release the lock.
> > *
> > * If on our own runqueue, don't grab or release the lock;
> > * but subtract our own load from the runqueue load to simulate
> > - * impartiality */
> > + * impartiality.
> > + *
> > + * svc's hard affinity may have changed; this function is the
> > + * credit 2 scheduler's first opportunity to react to the change,
> > + * so it is possible here that svc does not have hard affinity
> > + * with any of the pcpus of svc's currently assigned run queue.
> > + */
> > if ( rqd == svc->rqd )
> > {
> > - rqd_avgload = rqd->b_avgload - svc->avgload;
> > + if ( cpumask_intersects(vc->cpu_hard_affinity, &rqd->active) )
> > + rqd_avgload = rqd->b_avgload - svc->avgload;
> > }
> > else if ( spin_trylock(&rqd->lock) )
> > {
> > - rqd_avgload = rqd->b_avgload;
> > + if ( cpumask_intersects(vc->cpu_hard_affinity, &rqd->active) )
> > + rqd_avgload = rqd->b_avgload;
> > +
> > spin_unlock(&rqd->lock);
> > }
> > else
>
> Since we're already potentially falling through and doing the comparison
> below with an unchanged rqd_avgload (which has now been set to MAX_LOAD
> above), I wonder if it makes more sense to remove this "else continue"
> here, just to avoid confusing people.
>
Agreed! It was me that suggested Justing how to reorg this block of code
during v2's review... my bad not spotting that the 'else / continue' was
useless then! :-P
Regards,
Dario
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-04-23 16:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-26 9:48 [PATCH v3 0/4] sched: credit2: introduce per-vcpu hard and soft affinity Justin T. Weaver
2015-03-26 9:48 ` [PATCH v3 1/4] sched: credit2: respect per-vcpu hard affinity Justin T. Weaver
2015-03-31 14:37 ` George Dunlap
2015-03-31 17:14 ` Dario Faggioli
2015-03-31 17:32 ` George Dunlap
2015-04-23 16:00 ` Dario Faggioli [this message]
2015-05-06 12:39 ` Dario Faggioli
2015-03-26 9:48 ` [PATCH v3 2/4] sched: factor out per-vcpu affinity related code to common header file Justin T. Weaver
2015-04-23 15:22 ` Dario Faggioli
2015-03-26 9:48 ` [PATCH v3 3/4] sched: credit2: indent code sections to make review of patch 4/4 easier Justin T. Weaver
2015-04-23 15:35 ` Dario Faggioli
2015-03-26 9:48 ` [PATCH v3 4/4] sched: credit2: consider per-vcpu soft affinity Justin T. Weaver
2015-03-31 17:38 ` George Dunlap
2015-04-20 15:38 ` George Dunlap
2015-04-22 16:16 ` George Dunlap
2015-09-17 14:27 ` [PATCH v3 0/4] sched: credit2: introduce per-vcpu hard and " Dario Faggioli
2015-09-17 15:15 ` Dario Faggioli
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=1429804821.18926.199.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=henric@hawaii.edu \
--cc=jtweaver@hawaii.edu \
--cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.