mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: musl@lists.openwall.com
Subject: Re: What's left for 1.1.11 release?
Date: Tue, 28 Jul 2015 17:33:18 +0300 (MSK)	[thread overview]
Message-ID: <alpine.LNX.2.20.1507281716420.6514@monopod.intra.ispras.ru> (raw)
In-Reply-To: <1438092578.19958.4.camel@inria.fr>

> > and stdio locks too, but it's only been observed in malloc.
> > Since there don't seem to be any performance-relevant uses of a_store
> > that don't actually need the proper barrier, I think we have to just
> > put an explicit barrier (lock orl $0,(%esp) or mfence) after the store
> > and live with the loss of performance.
> 
> How about using a xchg as instruction? This would perhaps "waste" a
> register, but that sort of optimization should not be critical in the
> vicinity of code that needs memory synchronization, anyhow.

xchg is what compilers use in lieu of mfence, but Rich's preference for 'lock
orl' on the top of the stack stems from the idea that locking on the store
destination is not desired here (you might not even have the corresponding
line in the cache), so it might be better to have the store land in the store
buffers, and do a serializing 'lock orl' on the cache line you have anyhow.

Alexander


  parent reply	other threads:[~2015-07-28 14:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-28  3:40 Rich Felker
2015-07-28 14:09 ` Jens Gustedt
2015-07-28 14:18   ` Rich Felker
2015-07-28 14:50     ` Jens Gustedt
2015-07-28 14:58       ` Rich Felker
2015-07-28 15:15         ` Jens Gustedt
2015-07-28 16:07           ` Rich Felker
2015-07-28 16:42             ` Jens Gustedt
2015-07-28 17:33               ` Rich Felker
2015-07-28 14:33   ` Alexander Monakov [this message]
2015-07-28 17:31     ` Rich Felker

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=alpine.LNX.2.20.1507281716420.6514@monopod.intra.ispras.ru \
    --to=amonakov@ispras.ru \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).