regressions.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Alexey Klimov <alexey.klimov@linaro.org>, peterz@infradead.org
Cc: draszik@google.com, peter.griffin@linaro.org,
	willmcvicker@google.com, mingo@kernel.org,
	ulf.hansson@linaro.org, tony@atomide.com,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	axboe@kernel.dk, alim.akhtar@samsung.com,
	regressions@lists.linux.dev, avri.altman@wdc.com,
	klimova@google.com
Subject: Re: [REGRESSION] CPUIDLE_FLAG_RCU_IDLE, blk_mq_freeze_queue_wait() and slow-stuck reboots
Date: Tue, 14 Mar 2023 16:21:15 -0700	[thread overview]
Message-ID: <c98a3741-273b-8a69-016d-5f3e79f8a71e@acm.org> (raw)
In-Reply-To: <20230314230004.961993-1-alexey.klimov@linaro.org>

On 3/14/23 16:00, Alexey Klimov wrote:
> The delay is found to be in device's ->shutdown() methods called from kernel_restart():
> void kernel_restart_prepare(char *cmd)
> {
> 	blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd);
> 	system_state = SYSTEM_RESTART;
> 	usermodehelper_disable();
> 	device_shutdown();	<---- here
> }
> 
> The driver in question is ufshcd and its ufshcd_wl_shutdown() shutdown method. It often blocks on scsi_device_quiesce() and upon manual checking it seems that it sleeps on blk_mq_freeze_queue_wait()/wait_event() in blk_freeze_queue():
> 
> scsi_device_quiesce(struct scsi_device *sdev)
> {
> 	...
> 	blk_mq_freeze_queue(q);
> 	...
> }
> 	||
> 	V
> void blk_freeze_queue(struct request_queue *q)
> {
> 	/*
> 	 * In the !blk_mq case we are only calling this to kill the
> 	 * q_usage_counter, otherwise this increases the freeze depth
> 	 * and waits for it to return to zero.  For this reason there is
> 	 * no blk_unfreeze_queue(), and blk_freeze_queue() is not
> 	 * exported to drivers as the only user for unfreeze is blk_mq.
> 	 */
> 	blk_freeze_queue_start(q);
> 	blk_mq_freeze_queue_wait(q);	<--- sleeps on wait_event() here
> }

Please let me know if you want me to resubmit patch "scsi: ufs: Remove 
the LUN quiescing code from ufshcd_wl_shutdown()" 
(https://lore.kernel.org/linux-scsi/20220331223424.1054715-14-bvanassche@acm.org/).

Thanks,

Bart.


  reply	other threads:[~2023-03-14 23:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14 23:00 [REGRESSION] CPUIDLE_FLAG_RCU_IDLE, blk_mq_freeze_queue_wait() and slow-stuck reboots Alexey Klimov
2023-03-14 23:21 ` Bart Van Assche [this message]
2023-03-17  1:38   ` Alexey Klimov
2023-03-15 11:16 ` Peter Zijlstra
2023-03-17  2:11   ` Alexey Klimov
2023-03-20  9:05     ` Peter Zijlstra
2023-03-20  9:36       ` Peter Zijlstra
2023-04-11 16:16         ` Alexey Klimov
2023-03-20  9:22   ` Peter Zijlstra
2023-03-20 13:52 ` Mark Rutland
2023-03-20 16:04   ` Mark Rutland
2023-04-02 12:40     ` Linux regression tracking #update (Thorsten Leemhuis)

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=c98a3741-273b-8a69-016d-5f3e79f8a71e@acm.org \
    --to=bvanassche@acm.org \
    --cc=alexey.klimov@linaro.org \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=draszik@google.com \
    --cc=klimova@google.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peter.griffin@linaro.org \
    --cc=peterz@infradead.org \
    --cc=regressions@lists.linux.dev \
    --cc=tony@atomide.com \
    --cc=ulf.hansson@linaro.org \
    --cc=willmcvicker@google.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;
as well as URLs for NNTP newsgroup(s).