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 A7CE5346AFD for ; Mon, 29 Jun 2026 12:47:07 +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=1782737228; cv=none; b=LUqdc/9cqs60l5gqPPi11HZ1PWVExYRiIsE6s105D0+i2+wqbeFx0ZcTvJ6RERBjVtjTv/KkkWfo19+TKuNkB2MmtxnFC0DZ2FCcml4ndCxIbPQSNl5l7U2y6tDghtrryAUQJGKHNYdZyEj9ZuQciXM4FKtOPW2kFe5J11l8B2s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782737228; c=relaxed/simple; bh=3leyfFHik+SMJzzH7ImcKaEF42mh0jQVQXXEh3mNnuk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EVaTSwv8+9ZXPd2nh2B+iM3QogWxo5r5bqYYQepPSYRoVj0RWKjaKepiuxb/Qd4SW+SEADtoeN+3wD/uaPDAVGoR4BvbTfUdSpcqTjtDaI/1ErcpYq2sK/JYX6NQhhtoi2KF6uG85YxFiWPT1u4o/9IAF7zrDWrDo5afpONkzCA= 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 C08A468B05; Mon, 29 Jun 2026 14:47:03 +0200 (CEST) Date: Mon, 29 Jun 2026 14:47:03 +0200 From: Christoph Hellwig To: Nilay Shroff Cc: Christoph Hellwig , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, kbusch@kernel.org, sagi@grimberg.me, axboe@fb.com, bvanassche@acm.org, elver@google.com, gjoyce@linux.ibm.com Subject: Re: [PATCHv2 07/17] nvme: add Clang context annotations for nvme_subsystem::lock Message-ID: <20260629124703.GB23417@lst.de> References: <20260614131541.2017845-1-nilay@linux.ibm.com> <20260614131541.2017845-8-nilay@linux.ibm.com> <20260626064335.GG10731@lst.de> <0f3add6e-4e2c-4656-ad82-e86e18f6fcb7@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: <0f3add6e-4e2c-4656-ad82-e86e18f6fcb7@linux.ibm.com> User-Agent: Mutt/1.5.17 (2007-11-01) On Fri, Jun 26, 2026 at 08:09:52PM +0530, Nilay Shroff wrote: >> > yes correct, but this one is tricky as the list has to be inited > with non-zero value. Another way to fix this is by adding > context_unsafe wrapper around INIT_LIST_HEAD(). Again overuse of > those unsafe wrappers hinders readability. > > Would it make sense to introduce a helper, e.g. INIT_LIST_HEAD_UNSAFE(), > that simply wraps INIT_LIST_HEAD() with context_unsafe()? It would document > that this should only be used in cases where the caller knows the object > has not yet been published and therefore no concurrent access is possible, > such as during object initialization. I'll leave that to Marco and other core people, but I think this would be a lot better than the current version.