Bug 162417 - Fences on x86 should be a lot cheaper
Summary: Fences on x86 should be a lot cheaper
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on:
Blocks: 162316
  Show dependency treegraph
 
Reported: 2016-09-22 10:50 PDT by Filip Pizlo
Modified: 2016-09-22 17:11 PDT (History)
12 users (show)

See Also:


Attachments
the patch (6.27 KB, patch)
2016-09-22 13:55 PDT, Filip Pizlo
mark.lam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2016-09-22 10:50:13 PDT
Patch forthcoming.
Comment 1 Filip Pizlo 2016-09-22 13:55:23 PDT
Created attachment 289592 [details]
the patch
Comment 2 Mark Lam 2016-09-22 14:06:11 PDT
Comment on attachment 289592 [details]
the patch

View in context: https://bugs.webkit.org/attachment.cgi?id=289592&action=review

r=me

> Source/JavaScriptCore/ChangeLog:22
> +        compiles to Air MemoryFence, which is just MacroAssembler::memoryFene(), this also changes

/Fene/Fence/.
Comment 3 Geoffrey Garen 2016-09-22 14:07:01 PDT
r=me

Good fences make good neighbors.
Comment 4 Filip Pizlo 2016-09-22 14:12:46 PDT
(In reply to comment #2)
> Comment on attachment 289592 [details]
> the patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=289592&action=review
> 
> r=me
> 
> > Source/JavaScriptCore/ChangeLog:22
> > +        compiles to Air MemoryFence, which is just MacroAssembler::memoryFene(), this also changes
> 
> /Fene/Fence/.

Fixed.
Comment 5 Filip Pizlo 2016-09-22 14:15:15 PDT
Landed in https://trac.webkit.org/changeset/206274
Comment 6 JF Bastien 2016-09-22 15:45:43 PDT
Very cool!

I forgot to say when I suggested this: AFAIK this doesn't order non-temporals. You probably want to do lfence / sfence around Its anyways, so the point is moot. You may just have happened to get fencing for Its before because of the mfence :-)
Comment 7 Filip Pizlo 2016-09-22 17:11:51 PDT
(In reply to comment #6)
> Very cool!
> 
> I forgot to say when I suggested this: AFAIK this doesn't order
> non-temporals. You probably want to do lfence / sfence around Its anyways,
> so the point is moot. You may just have happened to get fencing for Its
> before because of the mfence :-)

Fortunately, I don't think we use non-temporals anywhere.  I had some code where I tried to use them at one point for memset, but that was when I found out that rep stosl is the bomb dot com.