lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZGvnJZYQfAmgdsqr@boqun-archlinux>
Date:   Mon, 22 May 2023 15:05:25 -0700
From:   Boqun Feng <boqun.feng@...il.com>
To:     Kent Overstreet <kent.overstreet@...ux.dev>
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 01:13:14PM -0400, Kent Overstreet wrote:
[...]
> +/*
> + * bits 0-26		reader count
> + * bits 26-27		write_locking (a thread is trying to get a write lock,
> + *			but does not have one yet)
> + * bits 27-28		held for intent
> + * bits 28-29		nospin - optimistic spinning has timed out

Still reading to understand the design (and try to find where are the
first five locks ;-)), but this comment seems to be wrong, because..

> + * 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.

Regards,
Boqun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ