Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1305378

Re: [PATCH] x86: Add an explicit barrier() to clflushopt()

From Andy Lutomirski <luto@amacapital.net>
Newsgroups linux.kernel
Subject Re: [PATCH] x86: Add an explicit barrier() to clflushopt()
Date 2016-01-09 23:40 +0100
Message-ID <qPakW-3yt-17@gated-at.bofh.it> (permalink)
References (4 earlier) <qOpYL-5eu-23@gated-at.bofh.it> <qOqLa-5yd-25@gated-at.bofh.it> <qOrnQ-63O-17@gated-at.bofh.it> <qOrnR-63O-47@gated-at.bofh.it> <qOWKZ-2Jn-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Jan 9, 2016 at 12:01 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Thu, Jan 07, 2016 at 02:32:23PM -0800, H. Peter Anvin wrote:
>> On 01/07/16 14:29, H. Peter Anvin wrote:
>> >
>> > I would be very interested in knowing if replacing the final clflushopt
>> > with a clflush would resolve your problems (in which case the last mb()
>> > shouldn't be necessary either.)
>> >
>>
>> Nevermind.  CLFLUSH is not ordered with regards to CLFLUSHOPT to the
>> same cache line.
>>
>> Could you add a sync_cpu(); call to the end (can replace the final mb())
>> and see if that helps your case?
>
> s/sync_cpu()/sync_core()/
>
> No. I still see failures on Baytrail and Braswell (Pineview is not
> affected) with the final mb() replaced with sync_core(). I can reproduce
> failures on Pineview by tweaking the clflush_cache_range() parameters,
> so I am fairly confident that it is validating the current code.
>
> iirc sync_core() is cpuid, a heavy serialising instruction, an
> alternative to mfence.  Is there anything that else I can infer about
> the nature of my bug from this result?

No clue, but I don't know much about the underlying architecture.

Can you try clflush_cache_ranging one cacheline less and then manually
doing clflushopt; mb on the last cache line, just to make sure that
the helper is really doing the right thing?  You could also try
clflush instead of clflushopt to see if that makes a difference.

--Andy


-- 
Andy Lutomirski
AMA Capital Management, LLC

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Chris Wilson <chris@chris-wilson.co.uk> - 2016-01-07 11:20 +0100
  Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Andy Lutomirski <luto@amacapital.net> - 2016-01-07 19:00 +0100
    Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Chris Wilson <chris@chris-wilson.co.uk> - 2016-01-07 20:50 +0100
      Re: [PATCH] x86: Add an explicit barrier() to clflushopt() "H. Peter Anvin" <hpa@zytor.com> - 2016-01-07 22:10 +0100
        Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Chris Wilson <chris@chris-wilson.co.uk> - 2016-01-07 23:00 +0100
          Re: [PATCH] x86: Add an explicit barrier() to clflushopt() "H. Peter Anvin" <hpa@zytor.com> - 2016-01-07 23:40 +0100
            Re: [PATCH] x86: Add an explicit barrier() to clflushopt() "H. Peter Anvin" <hpa@zytor.com> - 2016-01-07 23:40 +0100
              Re: [PATCH] x86: Add an explicit barrier() to clflushopt() "H. Peter Anvin" <hpa@zytor.com> - 2016-01-09 07:00 +0100
              Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Chris Wilson <chris@chris-wilson.co.uk> - 2016-01-09 09:10 +0100
                Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Andy Lutomirski <luto@amacapital.net> - 2016-01-09 23:40 +0100
                Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Chris Wilson <chris@chris-wilson.co.uk> - 2016-01-11 12:30 +0100
                Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Linus Torvalds <torvalds@linux-foundation.org> - 2016-01-11 21:20 +0100
                Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Chris Wilson <chris@chris-wilson.co.uk> - 2016-01-11 22:10 +0100
                Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Chris Wilson <chris@chris-wilson.co.uk> - 2016-01-12 17:40 +0100
                Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Linus Torvalds <torvalds@linux-foundation.org> - 2016-01-12 18:10 +0100
                Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Chris Wilson <chris@chris-wilson.co.uk> - 2016-01-12 22:20 +0100
                Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Linus Torvalds <torvalds@linux-foundation.org> - 2016-01-12 23:10 +0100
                Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Chris Wilson <chris@chris-wilson.co.uk> - 2016-01-13 02:00 +0100
                Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Linus Torvalds <torvalds@linux-foundation.org> - 2016-01-13 03:10 +0100
                Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Andy Lutomirski <luto@amacapital.net> - 2016-01-13 03:50 +0100
                Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Linus Torvalds <torvalds@linux-foundation.org> - 2016-01-13 05:40 +0100
                Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Chris Wilson <chris@chris-wilson.co.uk> - 2016-01-13 13:40 +0100
                Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Linus Torvalds <torvalds@linux-foundation.org> - 2016-01-13 19:50 +0100
                Re: [PATCH] x86: Add an explicit barrier() to clflushopt() "H. Peter Anvin" <hpa@zytor.com> - 2016-01-12 18:20 +0100

csiph-web