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 69DF31A5B8A for ; Mon, 29 Jun 2026 12:48:10 +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=1782737291; cv=none; b=i85vmPMsK9MW9J1S0Pm1T6p1SwhkZuUJVGMs7y/XOY6dXyO1oJW2csg0ZwgPMt6NWpt82ozPSLAQDAI35exlFvBnBnWCA5321hMiHPRfP73a+Q9daSdeeat9oF/WMOV8GEF0/EGD8dDR2pbZDza9KGSy1a9FHU6V5o5iGoStZcc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782737291; c=relaxed/simple; bh=t5oSYVi8oA+B/sKYaJ7HeKo2VSCMSIW3oddaJRNoLXc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gkihGefPxGV0Kz6DeHRDVsUXeUzy92+Nrxlf7u4f95f4hYWdKybGcK7+d2cWQw4lDifSlLbQ7ey53UHDmwJibrXFqCrHzH1KjzKV+MSnGCkK5n4VeT/IzSEs7flYplb9LpU4AegrMZZ1gR5yXyxg6uGdwluy+9ENBp1c2bnUGhk= 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 CCC7B68B05; Mon, 29 Jun 2026 14:48:07 +0200 (CEST) Date: Mon, 29 Jun 2026 14:48:06 +0200 From: Christoph Hellwig To: Nilay Shroff Cc: Marco Elver , Christoph Hellwig , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, kbusch@kernel.org, sagi@grimberg.me, axboe@fb.com, bvanassche@acm.org, gjoyce@linux.ibm.com Subject: Re: [PATCHv2 11/17] nvme: add Clang context annotations for nvme_queue::sq_lock Message-ID: <20260629124806.GD23417@lst.de> References: <20260614131541.2017845-1-nilay@linux.ibm.com> <20260614131541.2017845-12-nilay@linux.ibm.com> <20260626064721.GA11106@lst.de> <09fb5b3d-e5d0-4c7b-a333-9ca51286929b@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: <09fb5b3d-e5d0-4c7b-a333-9ca51286929b@linux.ibm.com> User-Agent: Mutt/1.5.17 (2007-11-01) On Fri, Jun 26, 2026 at 08:42:04PM +0530, Nilay Shroff wrote: > On 6/26/26 3:20 PM, Marco Elver wrote: >> On Fri, 26 Jun 2026 at 08:47, Christoph Hellwig wrote: >>> >>> On Sun, Jun 14, 2026 at 06:45:26PM +0530, Nilay Shroff wrote: >>>> Accesses to sq_tail used solely for tracing are annotated with >>>> context_unsafe(), as they only require a lockless snapshot of the >> >> This sounds like an intentional "benign" data race... >> > Yes, agreed. For the tracing case this is an intentional data race, > so it can simply be written as: > > trace_nvme_sq(req, cqe->sq_head, data_race(nvmeq->sq_tail)); Sounds good. I didn't know data_race already knew about context tracking, so this is a good solution.