From: George Dunlap <george.dunlap@eu.citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Marcus Granado <Marcus.Granado@eu.citrix.com>,
Dan Magenheimer <dan.magenheimer@oracle.com>,
Ian Campbell <Ian.Campbell@citrix.com>,
AnilMadhavapeddy <anil@recoil.org>,
Andrew Cooper <Andrew.Cooper3@citrix.com>,
Dario Faggioli <dario.faggioli@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Xen-Devel <xen-devel@lists.xen.org>, Matt Wilson <msw@amazon.com>,
Daniel De Graaf <dgdegra@tycho.nsa.gov>,
Juergen Gross <juergen.gross@ts.fujitsu.com>
Subject: Re: [PATCH 03 of 11 v4] xen: sched_credit: when picking, make sure we get an idle one, if any
Date: Mon, 18 Mar 2013 14:02:56 +0000 [thread overview]
Message-ID: <51471E90.5060104@eu.citrix.com> (raw)
In-Reply-To: <51430C4902000078000C5D9C@nat28.tlf.novell.com>
On 15/03/13 10:55, Jan Beulich wrote:
>>>> On 15.03.13 at 11:37, Dario Faggioli <dario.faggioli@citrix.com> wrote:
>> On ven, 2013-03-15 at 08:14 +0000, Jan Beulich wrote:
>> Perhaps I can turn the condition into something like this:
>>
>> if ( !cpumask_test_cpu(cpu, &cpus) )
>> cpu = cpumask_empty(&cpus) ? cpu : cpumask_cycle(cpu, &cpus);
>>
>> So that we pay the price less frequently?
> Given cpu < nr_cpu_ids before this, yes, that sounds right. Or
> you could simply switch the operands of the && in your original
> if(). Yet less expensive would be if you stored the result of
> cpumask_cycle() in another variable and copied it into "cpu"
> only if less than nr_cpu_ids. That would eliminate the need for
> cpumask_empty() altogether.
It seems to me like just switching the order would result in more
readable code.
Wouldn't hurt to add "Do the quick test first" to the comment so no one
switches it back. :-)
-George
next prev parent reply other threads:[~2013-03-18 14:02 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-15 2:30 [PATCH 00 of 11 v4] NUMA aware credit scheduling Dario Faggioli
2013-03-15 2:30 ` [PATCH 01 of 11 v4] xen, libxc: rename xenctl_cpumap to xenctl_bitmap Dario Faggioli
2013-03-15 2:30 ` [PATCH 02 of 11 v4] xen, libxc: introduce xc_nodemap_t Dario Faggioli
2013-03-15 2:30 ` [PATCH 03 of 11 v4] xen: sched_credit: when picking, make sure we get an idle one, if any Dario Faggioli
2013-03-15 8:14 ` Jan Beulich
2013-03-15 10:37 ` Dario Faggioli
2013-03-15 10:55 ` Jan Beulich
2013-03-18 14:02 ` George Dunlap [this message]
2013-03-18 14:23 ` Dario Faggioli
2013-03-15 2:30 ` [PATCH 04 of 11 v4] xen: sched_credit: let the scheduler know about node-affinity Dario Faggioli
2013-03-18 13:58 ` George Dunlap
2013-03-15 2:30 ` [PATCH 05 of 11 v4] xen: allow for explicitly specifying node-affinity Dario Faggioli
2013-03-15 8:17 ` Jan Beulich
2013-03-15 14:20 ` Daniel De Graaf
2013-03-16 7:11 ` Dario Faggioli
2013-03-15 2:30 ` [PATCH 06 of 11 v4] libxc: " Dario Faggioli
2013-03-15 2:30 ` [PATCH 07 of 11 v4] libxl: " Dario Faggioli
2013-03-18 14:33 ` Ian Campbell
2013-03-18 14:35 ` Dario Faggioli
2013-03-15 2:30 ` [PATCH 08 of 11 v4] libxl: optimize the calculation of how many VCPUs can run on a candidate Dario Faggioli
2013-03-18 14:34 ` Ian Campbell
2013-03-15 2:30 ` [PATCH 09 of 11 v4] libxl: automatic placement deals with node-affinity Dario Faggioli
2013-03-18 14:36 ` Ian Campbell
2013-03-15 2:30 ` [PATCH 10 of 11 v4] xl: add node-affinity to the output of `xl list` Dario Faggioli
2013-03-15 3:03 ` Dario Faggioli
2013-03-18 14:06 ` George Dunlap
2013-03-18 14:21 ` Dario Faggioli
2013-03-18 14:13 ` Ian Campbell
2013-03-18 14:22 ` Dario Faggioli
2013-03-15 2:30 ` [PATCH 11 of 11 v4] docs: rearrange and update NUMA placement documentation 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=51471E90.5060104@eu.citrix.com \
--to=george.dunlap@eu.citrix.com \
--cc=Andrew.Cooper3@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=Marcus.Granado@eu.citrix.com \
--cc=anil@recoil.org \
--cc=dan.magenheimer@oracle.com \
--cc=dario.faggioli@citrix.com \
--cc=dgdegra@tycho.nsa.gov \
--cc=juergen.gross@ts.fujitsu.com \
--cc=msw@amazon.com \
--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 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).