This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Avoid unnecessary busy loop in __lll_timedlock_wait on ARM.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]