The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Zqiang" <qiang.zhang@linux.dev>
To: "Marek Szyprowski" <m.szyprowski@samsung.com>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Jens Axboe" <axboe@kernel.dk>,
	"Paul E . McKenney" <paulmck@kernel.org>
Subject: Re: [PATCH] blk-mq: add missing call to srcu_barrier() in blk_mq_free_tag_set()
Date: Sat, 15 Aug 2026 01:34:43 +0000	[thread overview]
Message-ID: <8978485679799d4b17fca7505ff27e2fad7fae0c@linux.dev> (raw)
In-Reply-To: <20260812060510.3220294-1-m.szyprowski@samsung.com>

> 
> Commit 05c3e88488ed ("srcu: Queue sdp->work when the delay timer is
> successfully deleted") added a check in cleanup_srcu_struct() if the
> call to srcu_barrier() has been made before calling it, which
> revealed a missing call to srcu_barrier() before calling
> cleanup_srcu_struct(set->srcu). Fix this.


This warnings should be fix in cleanup_srcu_struct().
https://lore.kernel.org/oe-lkp/202608060833.bce92909-lkp@intel.com/

and the set->srcu only be used by synchronize_srcu(), there are no
call_srcu(), so the srcu_barrier() should not be invoke before cleanup

Thanks
Zqiang



> 
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> This fixes the following issue observed recently in linux-next:
> ------------[ cut here ]------------
>  WARNING: kernel/rcu/srcutree.c:706 at cleanup_srcu_struct+0x194/0x3d4, CPU#1: kworker/1:2/156
>  Modules linked in: s5p_mfc exynos_gsc s5p_jpeg videobuf2_dma_contig v4l2_mem2mem videobuf2_memops videobuf2_v4l2 videobuf2_common videodev mc
>  CPU: 1 UID: 0 PID: 156 Comm: kworker/1:2 Not tainted 7.2.0-rc3-00006-g05c3e88488ed-dirty #13430 PREEMPT
>  Hardware name: Samsung Exynos (Flattened Device Tree)
>  Workqueue: usb_hub_wq hub_event
>  Call trace:
>  unwind_backtrace from show_stack+0x10/0x14
>  show_stack from dump_stack_lvl+0x6c/0x8c
>  dump_stack_lvl from __warn+0x90/0x204
>  __warn from warn_slowpath_fmt+0x1b4/0x1bc
>  warn_slowpath_fmt from cleanup_srcu_struct+0x194/0x3d4
>  cleanup_srcu_struct from blk_mq_free_tag_set+0x138/0x158
>  blk_mq_free_tag_set from scsi_mq_free_tags+0x10/0x1c
>  scsi_mq_free_tags from scsi_remove_host+0x14c/0x170
>  scsi_remove_host from uas_disconnect+0x70/0x84
>  uas_disconnect from usb_unbind_interface+0x78/0x2b4
>  usb_unbind_interface from device_release_driver_internal+0x194/0x208
>  device_release_driver_internal from bus_remove_device+0xf8/0x1c8
>  bus_remove_device from device_del+0x138/0x3b0
>  device_del from usb_disable_device+0xec/0x22c
>  usb_disable_device from usb_disconnect+0xf8/0x2bc
>  usb_disconnect from hub_event+0x9a8/0x1c3c
>  hub_event from process_one_work+0x258/0x798
>  process_one_work from worker_thread+0x1bc/0x3cc
>  worker_thread from kthread+0x138/0x16c
>  kthread from ret_from_fork+0x14/0x28
>  Exception stack(0xf0dfdfb0 to 0xf0dfdff8)
>  dfa0: 00000000 00000000 00000000 00000000
>  dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
>  dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
>  irq event stamp: 23097
>  hardirqs last enabled at (23109): [<c0100bf8>] __irq_svc+0xb8/0xd0
>  hardirqs last disabled at (23118): [<c0100b94>] __irq_svc+0x54/0xd0
>  softirqs last enabled at (23094): [<c013ef54>] handle_softirqs+0x32c/0x58c
>  softirqs last disabled at (23065): [<c013f360>] __irq_exit_rcu+0x144/0x1f0
>  ---[ end trace 0000000000000000 ]---
> ---
>  block/blk-mq.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 2c850330a32b..a26a11c73ee3 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -4975,6 +4975,7 @@ void blk_mq_free_tag_set(struct blk_mq_tag_set *set)
>  srcu_barrier(&set->tags_srcu);
>  cleanup_srcu_struct(&set->tags_srcu);
>  if (set->flags & BLK_MQ_F_BLOCKING) {
> + srcu_barrier(set->srcu);
>  cleanup_srcu_struct(set->srcu);
>  kfree(set->srcu);
>  }
> -- 
> 2.43.0
>

      parent reply	other threads:[~2026-08-15  1:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260812060521eucas1p109a53a37ed0557d06aa7a68b613352aa@eucas1p1.samsung.com>
2026-08-12  6:05 ` [PATCH] blk-mq: add missing call to srcu_barrier() in blk_mq_free_tag_set() Marek Szyprowski
2026-08-12 14:07   ` Paul E. McKenney
2026-08-15  1:34   ` Zqiang [this message]

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=8978485679799d4b17fca7505ff27e2fad7fae0c@linux.dev \
    --to=qiang.zhang@linux.dev \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=paulmck@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