[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZGw+2abYSDohPG2E@moria.home.lan>
Date: Tue, 23 May 2023 00:19:37 -0400
From: Kent Overstreet <kent.overstreet@...ux.dev>
To: Boqun Feng <boqun.feng@...il.com>
Cc: linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Brian Foster <bfoster@...hat.com>,
Dave Chinner <dchinner@...hat.com>
Subject: Re: [PATCH v2] locking: SIX locks (shared/intent/exclusive)
On Mon, May 22, 2023 at 03:05:25PM -0700, Boqun Feng wrote:
> > + * bits 29-30 has read waiters
> > + * bits 30-31 has intent waiters
> > + * bits 31-32 has write waiters
> > + */
> > +
> > +#define SIX_LOCK_HELD_read_OFFSET 0
> > +#define SIX_LOCK_HELD_read ~(~0U << 26)
> > +#define SIX_LOCK_HELD_intent (1U << 26)
> > +#define SIX_LOCK_HELD_write (1U << 27)
> > +#define SIX_LOCK_WAITING_read (1U << (28 + SIX_LOCK_read))
> > +#define SIX_LOCK_WAITING_intent (1U << (28 + SIX_LOCK_intent))
> > +#define SIX_LOCK_WAITING_write (1U << (28 + SIX_LOCK_write))
> > +#define SIX_LOCK_NOSPIN (1U << 31)
>
> ^ NOSPIN is the 31st bit.
Thanks - I think I'll just delete that comment, it's out of date and
the state bits have simplified a bit :)
Powered by blists - more mailing lists