public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hjl.tools at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug string/27457] vzeroupper use in AVX2 multiarch string functions cause HTM aborts
Date: Mon, 01 Mar 2021 14:47:49 +0000	[thread overview]
Message-ID: <bug-27457-131-FMct1LPGeb@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27457-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=27457

--- Comment #19 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Richard Biener from comment #17)
> (In reply to H.J. Lu from comment #11)
> > (In reply to Florian Weimer from comment #9)
> > > (In reply to rguenther from comment #7)
> > > > On Mon, 1 Mar 2021, fweimer at redhat dot com wrote:
> > > > > The sources do not seem to show the selection logic.
> > > > > __memset_avx2_unaligned_rtm seems to simply have dropped the VZEROUPPER
> > > > > instruction, which can't be good for general application performance.
> > > > 
> > > > The intent was to use %ymm16+ only which does not cause any transition
> > > > penalty even w/o vzeroupper.
> > > 
> > > I still saw %ymm0 usage in the disassembly, if I recall correctly. And for
> > > AVX2, there isn't much choice. I didn't try to reverse-engineer the
> > > corresponding IFUNC selector.
> > 
> > At function exit, there is
> > 
> >   f3:	0f 01 d6             	xtest  
> >   f6:	74 04                	je     fc <__memset_avx2_unaligned_erms_rtm+0x5c>
> >   f8:	c5 fc 77             	vzeroall 
> >   fb:	c3                   	ret    
> >   fc:	c5 f8 77             	vzeroupper 
> >   ff:	c3                   	ret    
> 
> Btw, if the 'je' mispredicts to the vzeroupper case inside an transaction
> will the speculative execution of vzeroupper abort the transaction or
> does it only abort the transaction when retired?

My branch includes RTM test:

  for (i = 0; i < loop; i++)
    {
      if (_xbegin() == _XBEGIN_STARTED)
        {
          failed |= function ();
          _xend();
        }
      else
        {
          failed |= function ();
          ++naborts;
        }
    }

It passes with xtest + je.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-03-01 14:47 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22 12:40 [Bug string/27457] New: " rguenth at gcc dot gnu.org
2021-02-22 12:40 ` [Bug string/27457] " rguenth at gcc dot gnu.org
2021-02-22 14:50 ` matz at suse dot de
2021-02-22 15:00 ` rguenth at gcc dot gnu.org
2021-02-22 15:26 ` hjl.tools at gmail dot com
2021-02-22 15:26 ` hjl.tools at gmail dot com
2021-02-22 18:45 ` fweimer at redhat dot com
2021-02-23  9:44 ` roman.dementiev at intel dot com
2021-02-27  2:39 ` hjl.tools at gmail dot com
2021-02-27  7:34 ` rguenther at suse dot de
2021-02-28 14:53 ` hjl.tools at gmail dot com
2021-03-01 11:32 ` fweimer at redhat dot com
2021-03-01 12:24 ` mliska at suse dot cz
2021-03-01 12:47 ` rguenther at suse dot de
2021-03-01 13:13 ` roman.dementiev at intel dot com
2021-03-01 13:19 ` fweimer at redhat dot com
2021-03-01 13:21 ` hjl.tools at gmail dot com
2021-03-01 13:24 ` hjl.tools at gmail dot com
2021-03-01 13:27 ` hjl.tools at gmail dot com
2021-03-01 13:29 ` hjl.tools at gmail dot com
2021-03-01 13:44 ` rguenth at gcc dot gnu.org
2021-03-01 14:05 ` hjl.tools at gmail dot com
2021-03-01 14:14 ` rguenther at suse dot de
2021-03-01 14:25 ` rguenth at gcc dot gnu.org
2021-03-01 14:37 ` hjl.tools at gmail dot com
2021-03-01 14:47 ` hjl.tools at gmail dot com [this message]
2021-03-01 14:49 ` rguenth at gcc dot gnu.org
2021-03-01 14:53 ` rguenth at gcc dot gnu.org
2021-03-01 15:19 ` hjl.tools at gmail dot com
2021-03-01 23:39 ` hjl.tools at gmail dot com
2021-03-05 16:54 ` hjl.tools at gmail dot com
2021-03-11 10:42 ` rguenth at gcc dot gnu.org
2021-03-16 13:53 ` rguenth at gcc dot gnu.org
2021-03-16 14:12 ` hjl.tools at gmail dot com
2021-03-29 23:00 ` hjl.tools at gmail dot com
2022-01-27 20:21 ` cvs-commit at gcc dot gnu.org
2022-01-27 20:23 ` cvs-commit at gcc dot gnu.org
2022-01-27 20:47 ` cvs-commit at gcc dot gnu.org
2022-01-27 20:47 ` cvs-commit at gcc dot gnu.org
2022-01-27 20:48 ` cvs-commit at gcc dot gnu.org
2022-01-27 22:41 ` cvs-commit at gcc dot gnu.org
2022-01-28  2:24 ` hjl.tools at gmail dot com

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=bug-27457-131-FMct1LPGeb@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).