From: Chris Wilson <chris@chris-wilson.co.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>,
"H. Peter Anvin" <hpa@zytor.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Ross Zwisler <ross.zwisler@linux.intel.com>,
"H . Peter Anvin" <hpa@linux.intel.com>,
Borislav Petkov <bp@alien8.de>, Brian Gerst <brgerst@gmail.com>,
Denys Vlasenko <dvlasenk@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Imre Deak <imre.deak@intel.com>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
DRI <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] x86: Add an explicit barrier() to clflushopt()
Date: Wed, 13 Jan 2016 00:55:21 +0000 [thread overview]
Message-ID: <20160113005521.GD25945@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <CA+55aFzm-41gStykT-57Ne-7u7o-XMa3A9VY0qYbEX+bxFDXsg@mail.gmail.com>
On Tue, Jan 12, 2016 at 02:07:35PM -0800, Linus Torvalds wrote:
> On Tue, Jan 12, 2016 at 1:13 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > Indeed. So I replaced the post-clflush_cache_range() clflush() with a
> > udelay(10) instead, and the corruption vanished. Putting the udelay(10)
> > before the clflush_cache_range() does not fix the corruption.
>
> Odd.
>
> > passes, I'm inclined to point the finger at the mb() following the
> > clflush_cache_range().
>
> We have an entirely unrelated discussion about the value of "mfence"
> as a memory barrier.
>
> Mind trying to just make the memory barrier (in
> arch/x86/include/asm/barrier.h) be a locked op instead?
Replacing the following mb() in clflush_cache_range() with
"lock; addl $0,0(%%rsp)" gave no improvement. Neither did replacing all
mb(). Undoubtably the memory stream as seen by the CPU is serialised.
The concern then is back to the visibility of the stream from the external
device. Adding an uncached mmio read after the clflush_cache_range()
also works, but I'm not clear if this achieves anything other than
inserting a delay or if it is flushing some other write buffer in the
chipset. It is odd that is required after the clflush_cache_range() and
ineffective before. It is also odd that such a flush would be needed
multiple times after the GPU write.
The double clflush() remains a mystery.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
next prev parent reply other threads:[~2016-01-13 0:56 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-19 9:58 Chris Wilson
2015-10-19 10:16 ` Borislav Petkov
2015-10-19 11:05 ` Chris Wilson
2015-10-19 11:25 ` Borislav Petkov
2015-10-19 18:29 ` Ross Zwisler
2016-01-07 10:16 ` Chris Wilson
2016-01-07 17:55 ` Andy Lutomirski
2016-01-07 19:44 ` Chris Wilson
2016-01-07 21:05 ` H. Peter Anvin
2016-01-07 21:54 ` Chris Wilson
2016-01-07 22:29 ` H. Peter Anvin
2016-01-07 22:32 ` H. Peter Anvin
2016-01-09 5:55 ` H. Peter Anvin
2016-01-09 8:01 ` Chris Wilson
2016-01-09 22:36 ` Andy Lutomirski
2016-01-11 11:28 ` Chris Wilson
2016-01-11 20:11 ` Linus Torvalds
2016-01-11 21:05 ` Chris Wilson
2016-01-12 16:37 ` Chris Wilson
2016-01-12 17:05 ` Linus Torvalds
2016-01-12 21:13 ` Chris Wilson
2016-01-12 22:07 ` Linus Torvalds
2016-01-13 0:55 ` Chris Wilson [this message]
2016-01-13 2:06 ` Linus Torvalds
2016-01-13 2:42 ` Andy Lutomirski
2016-01-13 4:39 ` Linus Torvalds
2016-01-13 12:34 ` Chris Wilson
2016-01-13 18:45 ` Linus Torvalds
2016-01-12 17:17 ` H. Peter Anvin
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=20160113005521.GD25945@nuc-i3427.alporthouse.com \
--to=chris@chris-wilson.co.uk \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=dvlasenk@redhat.com \
--cc=hpa@linux.intel.com \
--cc=hpa@zytor.com \
--cc=imre.deak@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=ross.zwisler@linux.intel.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®