From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98249C77B7A for ; Tue, 23 May 2023 04:19:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231142AbjEWETp (ORCPT ); Tue, 23 May 2023 00:19:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbjEWETn (ORCPT ); Tue, 23 May 2023 00:19:43 -0400 Received: from out-57.mta1.migadu.com (out-57.mta1.migadu.com [IPv6:2001:41d0:203:375::39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC385FA for ; Mon, 22 May 2023 21:19:42 -0700 (PDT) Date: Tue, 23 May 2023 00:19:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1684815581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cMAr9JP2hoTAH+Bide6gNNQRYXdTO7ObonfjjJc9oAw=; b=oXT0gBS0u1+rwwEAfPnn9QDggZKtT2BAOBV7RLC3zSDszYSfm4EuvaQgdu7QcBnDUYC9lQ KhWQE+igjycWN7q3usgRZ2GkTp3wusMtP5h7YCqfcMEksGjEJsLkYtwuJUpTSUuHPruATl /iak359vRwlqxuUyXeUYAlFaaWmgu0s= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Boqun Feng Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Linus Torvalds , Brian Foster , Dave Chinner Subject: Re: [PATCH v2] locking: SIX locks (shared/intent/exclusive) Message-ID: References: <20230522171314.1953699-1-kent.overstreet@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 :)