From: Dario Faggioli <dario.faggioli@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
George Dunlap <george.dunlap@citrix.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH] xen: credit2: clear bit instead of skip step in runq_tickle()
Date: Wed, 18 Jan 2017 12:05:26 +0100 [thread overview]
Message-ID: <1484737526.7492.74.camel@citrix.com> (raw)
In-Reply-To: <587F51C402000078001312AE@prv-mh.provo.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 1463 bytes --]
On Wed, 2017-01-18 at 03:30 -0700, Jan Beulich wrote:
> > > > On 18.01.17 at 11:21, <george.dunlap@citrix.com> wrote:
> > On 18/01/17 00:30, Dario Faggioli wrote:
> > >
> > > --- a/xen/common/sched_credit2.c
> > > +++ b/xen/common/sched_credit2.c
> > > @@ -985,7 +985,7 @@ runq_tickle(const struct scheduler *ops,
> > > struct csched2_vcpu *new, s_time_t now)
> > > cpumask_andnot(&mask, &rqd->active, &rqd->idle);
> > > cpumask_andnot(&mask, &mask, &rqd->tickled);
> > > cpumask_and(&mask, &mask, new->vcpu->cpu_hard_affinity);
> > > - if ( cpumask_test_cpu(cpu, &mask) )
> > > + if ( __cpumask_test_and_clear_cpu(cpu, &mask) )
> >
> > Since we're micro-optimizing -- isn't test-and-clear a locked
> > operation?
> > Would that be more expensive than the if() statement below?
>
> cpumask_test_and_clear_cpu() is, but __cpumask_test_and_clear_cpu()
> isn't.
>
As Jan said.
And, FWIW, I personally like how the code looks after this patch
better, even leaving aside performance.
I find it cleaner (probably because dislike 'continue'), and more in
line with what we do in the rest of the file.
Thanks and Regadrs,
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-01-18 11:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-18 0:30 [PATCH] xen: credit2: clear bit instead of skip step in runq_tickle() Dario Faggioli
2017-01-18 10:21 ` George Dunlap
2017-01-18 10:30 ` Jan Beulich
2017-01-18 11:05 ` Dario Faggioli [this message]
2017-01-26 1:00 ` Dario Faggioli
2017-02-01 15:00 ` 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=1484737526.7492.74.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=JBeulich@suse.com \
--cc=george.dunlap@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--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).