From: Davidlohr Bueso <dave@stgolabs.net>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
jbaron@akamai.com, viro@zeniv.linux.org.uk,
linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible
Date: Thu, 6 Sep 2018 13:55:17 -0700 [thread overview]
Message-ID: <20180906205517.GC31080@linux-r8p5> (raw)
In-Reply-To: <20180906191140.GA4816@worktop.programming.kicks-ass.net>
On Thu, 06 Sep 2018, Peter Zijlstra wrote:
>On Fri, Jul 20, 2018 at 01:05:59PM -0700, Davidlohr Bueso wrote:
>> On Fri, 20 Jul 2018, Andrew Morton wrote:
>
>> >I'm surprised. Is spin_lock_irqsave() significantly more expensive
>> >than spin_lock_irq()? Relative to all the other stuff those functions
>> >are doing? If so, how come? Some architectural thing makes
>> >local_irq_save() much more costly than local_irq_disable()?
>>
>> For example, if you compare x86 native_restore_fl() to xen_restore_fl(),
>> the cost of Xen is much higher.
>
>Xen is a moot argument. IIRC the point is that POPF (as used by
>*irqrestore()) is a very expensive operation because it changes all
>flags and thus has very 'difficult' instruction dependencies, killing
>the front end reorder and generating a giant bubble in the pipeline.
>
>Similarly, I suppose PUSHF is an expensive instruction because it needs
>all the flags 'stable' and thus needs to wait for a fair number of prior
>instructions to retire before it can get on with it.
>
>Combined the whole PUSHF + POPF is _far_ more expensive than STI + CLI,
>because the latter only has dependencies on instructions that muck about
>with IF -- not that many.
ack.
In fact it turns out that my Xen numbers for this patch were actually
native (popf), and not the xen_restore_fl() as it was using hvm and
not paravirt.
Thanks,
Davidlohr
prev parent reply other threads:[~2018-09-06 20:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-20 17:29 [PATCH -next 0/2] fs/epoll: loosen irq safety when possible Davidlohr Bueso
2018-07-20 17:29 ` [PATCH 1/2] fs/epoll: loosen irq safety in ep_scan_ready_list() Davidlohr Bueso
2018-07-20 17:29 ` [PATCH 2/2] fs/epoll: loosen irq safety in epoll_insert() and epoll_remove() Davidlohr Bueso
2018-07-20 19:42 ` [PATCH -next 0/2] fs/epoll: loosen irq safety when possible Andrew Morton
2018-07-20 20:05 ` Davidlohr Bueso
2018-07-20 20:44 ` Andrew Morton
2018-07-21 0:22 ` Davidlohr Bueso
2018-07-21 17:21 ` Davidlohr Bueso
2018-07-21 17:39 ` Peter Zijlstra
2018-07-21 18:31 ` Davidlohr Bueso
2018-07-24 23:43 ` Andrew Morton
2018-09-06 19:11 ` Peter Zijlstra
2018-09-06 20:55 ` Davidlohr Bueso [this message]
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=20180906205517.GC31080@linux-r8p5 \
--to=dave@stgolabs.net \
--cc=akpm@linux-foundation.org \
--cc=jbaron@akamai.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=viro@zeniv.linux.org.uk \
/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).