From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C7D53CD8D3 for ; Fri, 26 Jun 2026 06:45:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782456332; cv=none; b=gei5RiFE1KVbhfFkPyDMS7Xi1j9OcFQaEkPX+0rQeNwFCrl7p1c6I6T3/c1E6Rh71ykGYWamaQxkP2kyy1YvPZrTFW1UnY869u71566FT1uF6HUDbU+8zL7e55Aa+FYASSMTHB1xMuv/lriq3WkoGwQc7v/ecKOvs4EWqB+bfnA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782456332; c=relaxed/simple; bh=Ov95VenPZ4hE6v3yclEF3m2P/sW1HsV3sjCLLQLKzn0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Z3hKp50zLtziCToYH4lDHWXn+O9yz9ANrqyMU0inIhmPvQdCpKaLi6bSjSTWix2LBgtdW+4dIMPkRnu5mEGkIGdlQT0xeizKr1Lu3kboUFVU6/YH3u7Xa+2lGkxoXPRuBu2aTn1WHV0ydqgB3JJgyeVLmLJRbZod6MDPjuH6B0s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 8A1FF68B05; Fri, 26 Jun 2026 08:45:28 +0200 (CEST) Date: Fri, 26 Jun 2026 08:45:28 +0200 From: Christoph Hellwig To: Nilay Shroff Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, hch@lst.de, kbusch@kernel.org, sagi@grimberg.me, axboe@fb.com, bvanassche@acm.org, elver@google.com, gjoyce@linux.ibm.com Subject: Re: [PATCHv2 09/17] nvme: add Clang context annotations for nvme_subsystems_lock Message-ID: <20260626064528.GI10731@lst.de> References: <20260614131541.2017845-1-nilay@linux.ibm.com> <20260614131541.2017845-10-nilay@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260614131541.2017845-10-nilay@linux.ibm.com> User-Agent: Mutt/1.5.17 (2007-11-01) > -static LIST_HEAD(nvme_subsystems); > +static __guarded_by(&nvme_subsystems_lock) LIST_HEAD(nvme_subsystems); Having the guard_by before the LIST_HEAD makes this a real mess to read. Can we add a #define LIST_HEAD_GUARDED(_list, _lock) \ __guarded_by(_lock) LIST_HEAD(_list) and use that instead? And maybe do these after the lock declaration. While the compiler doesn't care, that's much easier to follow for humans. > + /* > + * Initializing subsys->ctrls list doesn't need to be protected > + * using @nvme_subsystems_lock. So suppress the Clang's warning > + * declaring context_unsafe. > + */ > + context_unsafe(INIT_LIST_HEAD(&subsys->ctrls)); This could also use a helper.