Linux block layer
 help / color / mirror / Atom feed
From: Nilay Shroff <nilay@linux.ibm.com>
To: Bart Van Assche <bvanassche@acm.org>, Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>,
	Damien Le Moal <dlemoal@kernel.org>,
	Marco Elver <elver@google.com>, Christoph Hellwig <hch@lst.de>,
	Justin Sanders <justin@coraid.com>
Subject: Re: [PATCH v2 01/12] aoe: Enable lock context analysis
Date: Tue, 4 Aug 2026 10:39:57 +0530	[thread overview]
Message-ID: <7c3545fd-0d87-47a3-9c31-59449d2ffdf5@linux.ibm.com> (raw)
In-Reply-To: <7f909bdc-b151-4aca-8602-434685ddc9a5@acm.org>

On 8/3/26 10:54 PM, Bart Van Assche wrote:
> On 8/3/26 5:53 AM, Nilay Shroff wrote:
>> As I see, iocq->lock guards iocq->head. So shouldn't we annotate
>> iocq->head with __guarded_by(iocq->lock)? For instance,
>>
>> struct iocq_ktio {
>>      struct list_head head;
>>                  __guarded_by(&lock);
>>      spinlock_t lock;
>> };
> 
> How about integrating the change below into this patch?
> 
> diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
> index 54c57b9f8894..7ceda4ee4e55 100644
> --- a/drivers/block/aoe/aoecmd.c
> +++ b/drivers/block/aoe/aoecmd.c
> @@ -51,8 +51,8 @@ static struct ktstate *kts;
> 
>   /* io completion queue */
>   struct iocq_ktio {
> -    struct list_head head;
>       spinlock_t lock;
> +    struct list_head head __guarded_by(&lock);
>   };
>   static struct iocq_ktio *iocq;
> 
> @@ -1717,8 +1717,8 @@ aoecmd_init(void)
>       }
> 
>       for (i = 0; i < ncpus; i++) {
> -        INIT_LIST_HEAD(&iocq[i].head);
> -        spin_lock_init(&iocq[i].lock);
> +        scoped_guard(spinlock_init, &iocq[i].lock)
> +            INIT_LIST_HEAD(&iocq[i].head);

This looks good to me, except for the use of scoped_guard() here.
Christoph has previously expressed a preference against using
scoped_guard():
https://lore.kernel.org/all/20260626063738.GD10731@lst.de/

So lets just see what's his opinion on this change.

Thanks,
--Nilay



  reply	other threads:[~2026-08-04  5:10 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 19:58 [PATCH v2 00/12] Enable lock context analysis in drivers/block/ Bart Van Assche
2026-07-30 19:58 ` [PATCH v2 01/12] aoe: Enable lock context analysis Bart Van Assche
2026-08-03 12:53   ` Nilay Shroff
2026-08-03 17:24     ` Bart Van Assche
2026-08-04  5:09       ` Nilay Shroff [this message]
2026-07-30 19:58 ` [PATCH v2 02/12] loop: Remove the "bool global" function argument Bart Van Assche
2026-08-03 13:05   ` Nilay Shroff
2026-08-03 17:41     ` Bart Van Assche
2026-08-04  6:53       ` Nilay Shroff
2026-07-30 19:58 ` [PATCH v2 03/12] loop: Add lock context annotations Bart Van Assche
2026-08-03 13:11   ` Nilay Shroff
2026-08-03 17:43     ` Bart Van Assche
2026-08-04  7:02       ` Nilay Shroff
2026-07-30 19:58 ` [PATCH v2 04/12] mtip32: Enable lock context analysis Bart Van Assche
2026-08-03 13:16   ` Nilay Shroff
2026-07-30 19:58 ` [PATCH v2 05/12] nbd: " Bart Van Assche
2026-08-03 13:26   ` Nilay Shroff
2026-08-03 18:03     ` Bart Van Assche
2026-08-04  7:10       ` Nilay Shroff
2026-08-04  9:25       ` Marco Elver
2026-08-04 11:27         ` Nilay Shroff
2026-07-30 19:58 ` [PATCH v2 06/12] null_blk: " Bart Van Assche
2026-08-03 13:35   ` Nilay Shroff
2026-08-03 18:09     ` Bart Van Assche
2026-08-04  7:40       ` Nilay Shroff
2026-07-30 19:58 ` [PATCH v2 07/12] rbd: " Bart Van Assche
2026-08-03 14:03   ` Nilay Shroff
2026-08-03 19:46     ` Bart Van Assche
2026-08-04 10:48       ` Nilay Shroff
2026-08-04 18:24         ` Bart Van Assche
2026-08-06  9:27           ` Marco Elver
2026-07-30 19:58 ` [PATCH v2 08/12] ublk: " Bart Van Assche
2026-07-30 19:58 ` [PATCH v2 09/12] xen-blkback: " Bart Van Assche
2026-07-30 19:58 ` [PATCH v2 10/12] zram: " Bart Van Assche
2026-07-30 19:58 ` [PATCH v2 11/12] rnbd: " Bart Van Assche
2026-07-30 19:58 ` [PATCH v2 12/12] block: Enable lock context analysis for all block drivers Bart Van Assche
2026-08-03 14:22 ` [PATCH v2 00/12] Enable lock context analysis in drivers/block/ Nilay Shroff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7c3545fd-0d87-47a3-9c31-59449d2ffdf5@linux.ibm.com \
    --to=nilay@linux.ibm.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=dlemoal@kernel.org \
    --cc=elver@google.com \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=justin@coraid.com \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox