<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>169510</bug_id>
          
          <creation_ts>2017-03-11 00:46:59 -0800</creation_ts>
          <short_desc>REGRESSION(r213645): It made JSC tests super slow and timeout on AArch64 Linux</short_desc>
          <delta_ts>2017-04-11 01:27:36 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>Blocker</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>108645</blocked>
    
    <blocked>169300</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Csaba Osztrogonác">ossy</reporter>
          <assigned_to name="Zan Dobersek">zan</assigned_to>
          <cc>benjamin</cc>
    
    <cc>buildbot</cc>
    
    <cc>cdumez</cc>
    
    <cc>clopez</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>dbates</cc>
    
    <cc>fpizlo</cc>
    
    <cc>mark.lam</cc>
    
    <cc>ossy</cc>
    
    <cc>saam</cc>
    
    <cc>zan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1286105</commentid>
    <comment_count>0</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2017-03-11 00:46:59 -0800</bug_when>
    <thetext>before r213645: 
- https://build.webkit.org/builders/JSCOnly%20Linux%20AArch64%20Release/builds/4895
- runtime: 1h 15mins
- only 7 failures

after r213645: 
- https://build.webkit.org/builders/JSCOnly%20Linux%20AArch64%20Release/builds/4950
- runtime: 10h 30 mins (stopped after it, full test runtime would have taken days)
- zillion timeouts

Note, that https://trac.webkit.org/changeset/213645 broke the build too
which was fixed in https://trac.webkit.org/changeset/213705. But I tested
r213645 with the buildfix directly and it showed that r213645 caused this
serious regression.

Is there any way to disable this super slow new feature on Linux?
I don&apos;t and won&apos;t have to debug what caused this regeression in your patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1286136</commentid>
    <comment_count>1</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2017-03-11 05:58:11 -0800</bug_when>
    <thetext>I disabled it on Linux in https://trac.webkit.org/changeset/213758.

Please enable it again once somebody fixed this regression.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1286137</commentid>
    <comment_count>2</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2017-03-11 07:44:50 -0800</bug_when>
    <thetext>We should figure out what&apos;s going on here. This is probably not a Linux versus Darwin thing but a CPU model thing.

Here&apos;s a possible hint: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150921/300953.html

It looks like in LLVM, they have to emit clrex when exiting ldx/stx (LL/SC) loops because &quot;some uarchs&quot; need it for &quot;performance&quot;. I tried emitting clrex, and on my hardware, it made no difference.

I think in our jargon, &quot;clrex&quot; should be called &quot;WTF::clearLink()&quot;, since we use the old computer science terminology for this (load link, store conditional) rather than the ARM terminology (reservations).  The way this would look like is that you&apos;d want Atomic&lt;&gt;::transaction() to call clearLink() whenever it returns after having done a loadLink() but before the storeCond() - basically anytime that we would otherwise be leaving the link (the reservation) in place.

If this works then just as transaction() abstracts LL/SC and CAS behind prepare/attempt, you probably want a giveUp() method that is a wrapper for clearLink() on LL_SC platforms and a no-op on CAS platforms. You probably want clearLink() to only be declared when HAVE(LL_SC) just as loadLink()/storeCond() are only declared when HAVE(LL_SC).

I think it&apos;s OK to do clearLink() on all ARM64s, if it helps your perf.

If this works, then can you also put a FIXME in B3LowerToAir&apos;s code that emits loadlink/storecond, and MacroAssembler&apos;s loadLink/storeCond code, and link it to a bug?  Once I get around to implementing SharedArrayBuffer atomics, I&apos;ll definitely need to use MacroAssembler&apos;s and B3&apos;s LL/SC. It won&apos;t be possible to easily get around this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1287145</commentid>
    <comment_count>3</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2017-03-13 05:21:56 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; We should figure out what&apos;s going on here. This is probably not a Linux
&gt; versus Darwin thing but a CPU model thing.
...

Of course, yes and thanks for the detailed info. But as I said 
I don&apos;t and won&apos;t have to do it myself in the (near) future.

If somebody else is interested in debugging this issue,
feel free to pick it up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293729</commentid>
    <comment_count>4</comment_count>
      <attachid>306092</attachid>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2017-04-03 12:03:42 -0700</bug_when>
    <thetext>Created attachment 306092
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293730</commentid>
    <comment_count>5</comment_count>
    <who name="Build Bot">buildbot</who>
    <bug_when>2017-04-03 12:05:00 -0700</bug_when>
    <thetext>Attachment 306092 did not pass style-queue:


ERROR: Source/WTF/wtf/Atomics.h:193:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WTF/wtf/Atomics.h:213:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 2 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1296253</commentid>
    <comment_count>6</comment_count>
      <attachid>306092</attachid>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-04-10 19:23:35 -0700</bug_when>
    <thetext>Comment on attachment 306092
Patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1296315</commentid>
    <comment_count>7</comment_count>
      <attachid>306092</attachid>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2017-04-11 01:27:32 -0700</bug_when>
    <thetext>Comment on attachment 306092
Patch

Clearing flags on attachment: 306092

Committed r215220: &lt;http://trac.webkit.org/changeset/215220&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1296316</commentid>
    <comment_count>8</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2017-04-11 01:27:36 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>306092</attachid>
            <date>2017-04-03 12:03:42 -0700</date>
            <delta_ts>2017-04-11 01:27:32 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-169510-20170403210339.patch</filename>
            <type>text/plain</type>
            <size>2370</size>
            <attacher name="Zan Dobersek">zan</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjE0Nzg3CmRpZmYgLS1naXQgYS9Tb3VyY2UvV1RGL0NoYW5n
ZUxvZyBiL1NvdXJjZS9XVEYvQ2hhbmdlTG9nCmluZGV4IDY0OWRkZGNmZDcyOGM3YmI1ZTYxY2Fh
NzMyZmY3NGUzZmU1N2E0MDEuLjA4YzFhMjU2NDY2N2Y3N2QwYzgwOGVhOGVmZDAwNDBjNmY2Njc5
ZDkgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XVEYvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9XVEYvQ2hh
bmdlTG9nCkBAIC0xLDMgKzEsMjEgQEAKKzIwMTctMDQtMDMgIFphbiBEb2JlcnNlayAgPHpkb2Jl
cnNla0BpZ2FsaWEuY29tPgorCisgICAgICAgIFJFR1JFU1NJT04ocjIxMzY0NSk6IEl0IG1hZGUg
SlNDIHRlc3RzIHN1cGVyIHNsb3cgYW5kIHRpbWVvdXQgb24gQUFyY2g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VjMWVhZmM1OGVhNjhkMTgg
MTAwNjQ0Ci0tLSBhL1NvdXJjZS9XVEYvd3RmL0F0b21pY3MuaAorKysgYi9Tb3VyY2UvV1RGL3d0
Zi9BdG9taWNzLmgKQEAgLTE5MCw3ICsxOTAsNyBAQCBzdHJ1Y3QgQXRvbWljIHsKICAgICAgICAg
ICAgICAgICA6ICJyIih0aGlzKSBcCiAgICAgICAgICAgICAgICAgOiAibWVtb3J5Iik7IFwKICAg
ICAgICAgfSBlbHNlIHsgXAotICAgICAgICAgICAgYXNtICggXAorICAgICAgICAgICAgYXNtIHZv
bGF0aWxlICggXAogICAgICAgICAgICAgICAgICJsZHhyIiBzdWZmaXggIiAlIiBtb2RpZmllciAi
MCwgWyUxXSIgXAogICAgICAgICAgICAgICAgIDogIj1yIihyZXN1bHQpIFwKICAgICAgICAgICAg
ICAgICA6ICJyIih0aGlzKSBcCkBAIC0yMTAsNyArMjEwLDcgQEAgc3RydWN0IEF0b21pYyB7CiAg
ICAgICAgICAgICAgICAgOiAiciIodmFsdWUpLCAiciIodGhpcykgXAogICAgICAgICAgICAgICAg
IDogIm1lbW9yeSIpOyBcCiAgICAgICAgIH0gZWxzZSB7IFwKLSAgICAgICAgICAgIGFzbSAoIFwK
KyAgICAgICAgICAgIGFzbSB2b2xhdGlsZSAoIFwKICAgICAgICAgICAgICAgICAic3R4ciIgc3Vm
Zml4ICIgJXcwLCAlIiBtb2RpZmllciAiMSwgWyUyXSIgXAogICAgICAgICAgICAgICAgIDogIj0m
ciIocmVzdWx0KSBcCiAgICAgICAgICAgICAgICAgOiAiciIodmFsdWUpLCAiciIodGhpcykgXApk
aWZmIC0tZ2l0IGEvU291cmNlL1dURi93dGYvUGxhdGZvcm0uaCBiL1NvdXJjZS9XVEYvd3RmL1Bs
YXRmb3JtLmgKaW5kZXggZGYwZDdmZmYxNTgxODMyNjMyNjA1NDIzNjExMzhkODQ5NWYwMjAzOS4u
MjZjZDQ5N2FhMDYxNGZlNWVmYTY0ZGY5MDNkYWQ5ZDM4OGFhZTQyMSAxMDA2NDQKLS0tIGEvU291
cmNlL1dURi93dGYvUGxhdGZvcm0uaAorKysgYi9Tb3VyY2UvV1RGL3d0Zi9QbGF0Zm9ybS5oCkBA
IC03NTcsOCArNzU3LDcgQEAKICNkZWZpbmUgRU5BQkxFX0NPTkNVUlJFTlRfSlMgMQogI2VuZGlm
CiAKLS8qIEZJWE1FOiBFbmFibGUgaXQgb24gTGludXggb25jZSBodHRwczovL2J1Z3Mud2Via2l0
Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTY5NTEwIGlzIGZpeGVkLiAqLwotI2lmIENQVShBUk02NCkg
JiYgT1MoREFSV0lOKQorI2lmIENQVShBUk02NCkKICNkZWZpbmUgSEFWRV9MTF9TQyAxCiAjZW5k
aWYgLy8gQ1BVKEFSTTY0KSAmJiBPUyhEQVJXSU4pCiAK
</data>

          </attachment>
      

    </bug>

</bugzilla>