From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Tim Deegan <tim@xen.org>
Cc: Ian Campbell <Ian.Campbell@eu.citrix.com>,
xen-devel <xen-devel@lists.xenproject.org>,
Keir Fraser <keir@xen.org>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Jan Beulich <JBeulich@suse.com>
Subject: Re: [PATCH, RFC] x86/HVM: batch vCPU wakeups
Date: Wed, 10 Sep 2014 11:37:25 +0100 [thread overview]
Message-ID: <541029E5.9020809@citrix.com> (raw)
In-Reply-To: <20140910102924.GA44982@deinos.phlegethon.org>
On 10/09/14 11:29, Tim Deegan wrote:
> At 23:37 +0100 on 09 Sep (1410302243), Andrew Cooper wrote:
>>>> +void cpu_raise_softirq_batch_finish(void)
>>>> +{
>>>> + unsigned int cpu, this_cpu = smp_processor_id();
>>>> + cpumask_t *mask = &per_cpu(batch_mask, this_cpu);
>>> Again, this_cpu()?
>> ...But disagree here. Multiple uses of this_cpu($FOO) cannot be
>> coalesced due to RELOC_HIDE() deliberately preventing optimisation. For
>> multiple uses, pulling it out by pointer to start with results in rather
>> more efficient code.
> I wasn't questioning the pointer, but to the use of per_cpu(...,
> this_cpu) instead of this_cpu(...). Both of those involve a
> RELOC_HIDE().
>
> Anyway, it's pretty clear from your and Jan's replies that multiple
> this_cpu() invocations are slower -- thanks for the clarification!
>
> Tim.
The difference (if any) between per_cpu() vs this_cpu() depends on
whether the compiler decides to recalculate smp_processor_id() or not.
The former is manual optimisation on behalf of the programmer.
I am beginning to wonder whether the use of __attribute__((const)) might
help with get_cpu_info(). Despite the explicit stack pointer reference
which is undoubtedly the source of optimisation confusion for the
compiler, inside a function, the result of get_cpu_info() is genuinely
never going to change, even though the compiler can't necessarily prove
the fact.
~Andrew
next prev parent reply other threads:[~2014-09-10 10:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-09 8:33 [PATCH, RFC] x86/HVM: batch vCPU wakeups Jan Beulich
2014-09-09 9:33 ` Pasi Kärkkäinen
2014-09-09 9:54 ` Jan Beulich
2014-09-09 21:29 ` Tim Deegan
2014-09-09 22:37 ` Andrew Cooper
2014-09-10 10:29 ` Tim Deegan
2014-09-10 10:37 ` Andrew Cooper [this message]
2014-09-10 11:58 ` Jan Beulich
2014-09-10 9:28 ` Jan Beulich
2014-09-10 13:10 ` Jan Beulich
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=541029E5.9020809@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Campbell@eu.citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=keir@xen.org \
--cc=tim@xen.org \
--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 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.