From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 810373A759C for ; Fri, 26 Jun 2026 18:36:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782498990; cv=none; b=kPtpnxYFoOjMLwseutgpHbNdzi7ISxvRVcMPESGgZCREcQxseRDOKbpQW0D2VuqNs9zSdR26BXjH13hPNel3H3Mbsc/HQaD0o+L006qYstitaVy5bvnEj96NX2mStl7iP+mkuZAk8HyG6pmKSF2VEhkmcRuztc+KPwm0B6ouynQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782498990; c=relaxed/simple; bh=LSLr0bxgCxhiiEAzh/BfQ2cpdkS/EyilJ37uD1SBzbY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kpHCPxGrFATo1dI4O3XnwDwyt+Cn2XIp3lwlRWlNK9dnzBmfnXBChOFX9nVYKh3/IXD7SFciGid6kRoaJvIJ0x1saZr2ToXjQxSjnKZqDloYl/PjIgR/SESfch8rWuHcKch8E1R5fJ0nX6fl5r0dIhfIQFeKXOlYJLj0cLtxALs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iUyGrQ5G; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iUyGrQ5G" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29A101F000E9; Fri, 26 Jun 2026 18:36:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782498989; bh=uORHkl8NUV5fi96qCfKZFnoCayWmwU9pFoSiY0Pe6b4=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To; b=iUyGrQ5GyHcrug2qiwFxXlEWpRxVYFxYXoVGJxBaybYtXM4fq6lGjrH4gzKzvfOOX riyW5k2LFlQFruzASvDGj/KCx+sZO5mcbIPElRkF9OsxN7KqvmRdbWxWA5S2HKZsCf xM1p5JhNADxM5LAzL6xrnpEtePlHIVrYEncmpxj2023jMJdfvvQmArFEV9XsBIgL3V dqpon5I0ZWDMEXFpHz3pwO/lDqh17pHAXmKwhu+4iofaWHDhaQ6wyKNBMyqMe5GoA9 eA5MUY7pKSHM5nHVVAfgxfRW0LBjgjldj7ZuxoeBfk1MXec+y8ah1SgTEReE+7jj09 R7fYgX3TwCOmg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id E233CCE0A6F; Fri, 26 Jun 2026 11:36:28 -0700 (PDT) Date: Fri, 26 Jun 2026 11:36:28 -0700 From: "Paul E. McKenney" To: Christoph Hellwig Cc: Nilay Shroff , 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 05/17] nvme: add Clang context annotations for nvme_ns_head::current_path Message-ID: Reply-To: paulmck@kernel.org References: <20260614131541.2017845-1-nilay@linux.ibm.com> <20260614131541.2017845-6-nilay@linux.ibm.com> <20260626064050.GE10731@lst.de> 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: <20260626064050.GE10731@lst.de> On Fri, Jun 26, 2026 at 08:40:50AM +0200, Christoph Hellwig wrote: > On Sun, Jun 14, 2026 at 06:45:20PM +0530, Nilay Shroff wrote: > > +++ b/drivers/nvme/host/multipath.c > > @@ -231,8 +231,16 @@ bool nvme_mpath_clear_current_path(struct nvme_ns *ns) > > bool changed = false; > > int node; > > > > + /* > > + * This helper is used by namespace failover/teardown and I/O policy > > + * update paths. We only compare the head->current_path[] pointer value > > + * and do not dereference the referenced namespace, so suppress the > > + * context analysis warning for this lockless inspection of the > > + * __rcu_guarded pointer. > > + */ > > for_each_node(node) { > > - if (ns == rcu_access_pointer(head->current_path[node])) { > > + if (context_unsafe(ns == > > + rcu_access_pointer(head->current_path[node]))) { > > I think we need a helper for this, as for a simple pointer value > comparison without a dereference we don't really need either > rcu_access_pointer nor locking. > > Maybe somthing like a > > rcu_compare_pointer(rcu_pointer, nonrcu_pointer) > > ? We could provide something like this: #define rcu_compare_pointer(rcu_pointer, nonrcu_pointer) \ context_unsafe(rcu_access_pointer(rcu_pointer) == (nonrcu_pointer)) Or maybe rcu_pointer_equals()? Marco, thoughts? Thanx, Paul