public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: "Carlos O'Donell" <carlos@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: carlos@systemhalted.org, drow@false.org, joseph@codesourcery.com,
	       schwab@linux-m68k.org, thomas_schwinge@mentor.com,
	       kkojima@rr.iij4u.or.jp, marcus.shawcroft@linaro.org,
	       katsuki.uwatoko@toshiba.co.jp, libc-ports@sourceware.org
Subject: Re: [PATCH] Avoid unnecessary busy loop in __lll_timedlock_wait on ARM.
Date: Sat, 09 Feb 2013 14:56:00 -0000	[thread overview]
Message-ID: <5116636F.1040003@redhat.com> (raw)
In-Reply-To: <20130209.014909.573423212502453699.davem@davemloft.net>

On 02/09/2013 01:49 AM, David Miller wrote:
> From: "Carlos O'Donell" <carlos@systemhalted.org>
> Date: Fri, 8 Feb 2013 23:18:42 -0500
> 
>> I see that sparc32 also has a unique copy of lowlevellock.c Why the
>> use of *_24_* atomic primitives? Faster?
> 
> On pre-v9 32-bit sparc, we lack any usable atomic compare and
> swap.
> 
> All we have is an 8-bit spinlock.
> 
> So we implement things in a 32-bit word which is composed of a 24-bit
> counter and an 8-bit lock.
 
Thus a futex on sparc looks like this?

struct futex {
  union {
    int whole;
    struct {
      char lock;
      char value[3];
    } __split;
  } __futex;
};

With only 24-bits for the value?

I'll have to remember pre-v9 sparc only has 24-bits there.

I'd seen the *other* sparc pre-v9 implementation that used 64 global
locks per-library and that seemed signal unsafe and prone to deadlocks.

How do you deal with the FUTEX_WAITERS/FUTEX_OWNER_DIED bits that 
are set in the high bits of the word?

Or a tid that is 26-bits (FUTEX_TID_MASK)?

Cheers,
Carlos.

  reply	other threads:[~2013-02-09 14:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-31  8:42 katsuki.uwatoko
2013-02-07 23:33 ` Joseph S. Myers
2013-02-08  0:13   ` katsuki.uwatoko
2013-02-09  4:18   ` Carlos O'Donell
2013-02-09  6:49     ` David Miller
2013-02-09 14:56       ` Carlos O'Donell [this message]
2013-02-10  4:56         ` David Miller
2013-02-10 17:55           ` Carlos O'Donell
2013-02-12 21:41             ` Daniel Jacobowitz
2013-02-12 21:41               ` Daniel Jacobowitz
2013-02-12 21:57               ` Carlos O'Donell

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=5116636F.1040003@redhat.com \
    --to=carlos@redhat.com \
    --cc=carlos@systemhalted.org \
    --cc=davem@davemloft.net \
    --cc=drow@false.org \
    --cc=joseph@codesourcery.com \
    --cc=katsuki.uwatoko@toshiba.co.jp \
    --cc=kkojima@rr.iij4u.or.jp \
    --cc=libc-ports@sourceware.org \
    --cc=marcus.shawcroft@linaro.org \
    --cc=schwab@linux-m68k.org \
    --cc=thomas_schwinge@mentor.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.
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).