public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>, linux-block@vger.kernel.org
Subject: Re: [PATCH 2/2] blk-mq: ensure a q_usage_counter reference is held when splitting bios
Date: Thu, 11 Jan 2024 09:12:23 -0700	[thread overview]
Message-ID: <d713fe1b-3eaa-4de4-99a6-5910247ffad5@kernel.dk> (raw)
In-Reply-To: <20240111135705.2155518-3-hch@lst.de>

On 1/11/24 6:57 AM, Christoph Hellwig wrote:
> q_usage_counter is the only thing preventing us from the limits changing
> under us in __bio_split_to_limits, but blk_mq_submit_bio doesn't hold it.
> 
> Change __submit_bio to always acquire the q_usage_counter counter before
> branching out into bio vs request based helper, and let blk_mq_submit_bio
> tell it if it consumed the reference by handing it off to the request.

This causes hangs for me on shutdown/reset:

[   56.146054] sd 6:0:0:0: [sdb] Synchronizing SCSI cache
[   56.147739] sd 6:0:0:0: [sdb] Stopping disk
[   56.148976] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[   56.150803] sd 0:0:0:0: [sda] Stopping disk
[   75.549201] INFO: task systemd-shutdow:1 blocked for more than 15 seconds.
[   75.549636]       Not tainted 6.7.0-rc5-00173-g34d71db9cce2 #4540
[   75.549977] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[   75.550401] task:systemd-shutdow state:D stack:0     pid:1     tgid:1     ppid:0      flags:0x00000004
[   75.550900] Call trace:
[   75.551042]  __switch_to+0x114/0x150
[   75.551253]  __schedule+0x510/0x10d4
[   75.551451]  schedule+0x7c/0x1ac
[   75.551635]  schedule_timeout+0xe8/0x1a4
[   75.551857]  blk_mq_freeze_queue_wait_timeout+0xf4/0x18c
[   75.552157]  nvme_wait_freeze_timeout+0x68/0xa4
[   75.552503]  nvme_dev_disable+0x35c/0x374
[   75.552734]  nvme_shutdown+0x34/0x40
[   75.552956]  pci_device_shutdown+0x48/0x54
[   75.553184]  device_shutdown+0x1c4/0x314
[   75.553403]  kernel_power_off+0x40/0x88

which seems to indicate that a reference is being leaked. Haven't poked
any further at it, I'll drop these two for now.

-- 
Jens Axboe


  reply	other threads:[~2024-01-11 16:12 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-11 13:57 ensure q_usage_counter is held over bio splits Christoph Hellwig
2024-01-11 13:57 ` [PATCH 1/2] blk-mq: rename blk_mq_can_use_cached_rq Christoph Hellwig
2024-01-11 13:57 ` [PATCH 2/2] blk-mq: ensure a q_usage_counter reference is held when splitting bios Christoph Hellwig
2024-01-11 16:12   ` Jens Axboe [this message]
2024-01-11 16:14     ` Christoph Hellwig
2024-01-11 16:17       ` Jens Axboe
2024-01-11 16:18         ` Christoph Hellwig
2024-01-11 17:10         ` Christoph Hellwig
2024-01-11 17:18           ` Jens Axboe
2024-01-11 17:24             ` Christoph Hellwig
2024-01-11 20:06               ` Jens Axboe
2024-01-12  5:44                 ` Christoph Hellwig
2024-01-12 14:22                   ` Jens Axboe
2024-01-12 14:25                     ` Christoph Hellwig
2024-01-12 16:10                       ` Jens Axboe
2024-01-15 11:20                     ` Ulf Hansson
2024-01-22  7:34                       ` mmc vs highmem, was: " Christoph Hellwig
2024-01-22  9:26                         ` Arnd Bergmann
2024-01-22 13:39                           ` Christoph Hellwig
2024-01-22 14:57                             ` Arnd Bergmann
2024-01-23  9:11                               ` Christoph Hellwig
2024-01-24 11:59                                 ` Arnd Bergmann
2024-01-24 12:33                                   ` Linus Walleij
2024-01-24 12:54                                     ` Arnd Bergmann
2024-01-24 13:16                                       ` Linus Walleij
2024-01-24 14:14                                         ` Arnd Bergmann
2024-01-24 12:45                               ` Arnd Bergmann
2024-01-24 13:49                           ` Linus Walleij
2024-01-24 16:35                             ` Arnd Bergmann
2024-01-11 22:22   ` Ming Lei
2024-01-12  5:46     ` Christoph Hellwig
2024-01-11 16:03 ` ensure q_usage_counter is held over bio splits Jens Axboe
2024-01-14 14:38 ` (subset) " Jens Axboe

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=d713fe1b-3eaa-4de4-99a6-5910247ffad5@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    /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