Re: [PATCHv2 11/17] nvme: add Clang context annotations for nvme_queue::sq_lock
From: Christoph Hellwig
Date: Mon Jun 29 2026 - 08:50:22 EST
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 <hch@xxxxxx> 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.