All of lore.kernel.org
 help / color / mirror / Atom feed
From: Uday Shankar <ushankar@purestorage.com>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org,
	Caleb Sander Mateos <csander@purestorage.com>
Subject: Re: [PATCH 7/9] ublk: remove __ublk_quiesce_dev()
Date: Mon, 14 Apr 2025 14:37:22 -0600	[thread overview]
Message-ID: <Z/1yAhw6IZplHTXg@dev-ushankar.dev.purestorage.com> (raw)
In-Reply-To: <20250414112554.3025113-8-ming.lei@redhat.com>

On Mon, Apr 14, 2025 at 07:25:48PM +0800, Ming Lei wrote:
> Remove __ublk_quiesce_dev() and open code for updating device state as
> QUIESCED.
> 
> We needn't to drain inflight requests in __ublk_quiesce_dev() any more,
> because all inflight requests are aborted in ublk char device release
> handler.
> 
> Also we needn't to set ->canceling in __ublk_quiesce_dev() any more
> because it is done unconditionally now in ublk_ch_release().
> 
> Signed-off-by: Ming Lei <ming.lei@redhat.com>

Reviewed-by: Uday Shankar <ushankar@purestorage.com>

> ---
>  drivers/block/ublk_drv.c | 22 +---------------------
>  1 file changed, 1 insertion(+), 21 deletions(-)
> 
> diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
> index e02f205f6da4..f827c2ef00a9 100644
> --- a/drivers/block/ublk_drv.c
> +++ b/drivers/block/ublk_drv.c
> @@ -209,7 +209,6 @@ struct ublk_params_header {
>  
>  static void ublk_stop_dev_unlocked(struct ublk_device *ub);
>  static void ublk_abort_queue(struct ublk_device *ub, struct ublk_queue *ubq);
> -static void __ublk_quiesce_dev(struct ublk_device *ub);
>  static inline struct request *__ublk_check_and_get_req(struct ublk_device *ub,
>  		struct ublk_queue *ubq, int tag, size_t offset);
>  static inline unsigned int ublk_req_build_flags(struct request *req);
> @@ -1589,11 +1588,8 @@ static int ublk_ch_release(struct inode *inode, struct file *filp)
>  			/*
>  			 * keep request queue as quiesced for queuing new IO
>  			 * during QUIESCED state
> -			 *
> -			 * request queue will be unquiesced in ending
> -			 * recovery, see ublk_ctrl_end_recovery
>  			 */
> -			__ublk_quiesce_dev(ub);
> +			ub->dev_info.state = UBLK_S_DEV_QUIESCED;
>  		} else {
>  			ub->dev_info.state = UBLK_S_DEV_FAIL_IO;
>  			for (i = 0; i < ub->dev_info.nr_hw_queues; i++)
> @@ -1839,22 +1835,6 @@ static void ublk_wait_tagset_rqs_idle(struct ublk_device *ub)
>  	}
>  }
>  
> -/* Now all inflight requests have been aborted */
> -static void __ublk_quiesce_dev(struct ublk_device *ub)
> -{
> -	int i;
> -
> -	pr_devel("%s: quiesce ub: dev_id %d state %s\n",
> -			__func__, ub->dev_info.dev_id,
> -			ub->dev_info.state == UBLK_S_DEV_LIVE ?
> -			"LIVE" : "QUIESCED");
> -	/* mark every queue as canceling */
> -	for (i = 0; i < ub->dev_info.nr_hw_queues; i++)
> -		ublk_get_queue(ub, i)->canceling = true;
> -	ublk_wait_tagset_rqs_idle(ub);
> -	ub->dev_info.state = UBLK_S_DEV_QUIESCED;
> -}
> -
>  static void ublk_force_abort_dev(struct ublk_device *ub)
>  {
>  	int i;
> -- 
> 2.47.0
> 

  reply	other threads:[~2025-04-14 20:37 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14 11:25 [PATCH 0/9] ublk: simplify & improve IO canceling Ming Lei
2025-04-14 11:25 ` [PATCH 1/9] ublk: don't try to stop disk if ->ub_disk is NULL Ming Lei
2025-04-14 19:44   ` Uday Shankar
2025-04-15  1:32     ` Ming Lei
2025-04-14 11:25 ` [PATCH 2/9] ublk: properly serialize all FETCH_REQs Ming Lei
2025-04-14 19:58   ` Uday Shankar
2025-04-14 20:39     ` Jens Axboe
2025-04-14 20:52       ` Uday Shankar
2025-04-14 21:00         ` Jens Axboe
2025-04-15  1:40         ` Ming Lei
2025-04-16  1:13       ` Ming Lei
2025-04-16  1:17         ` Jens Axboe
2025-04-16  2:04           ` Ming Lei
2025-04-16  1:04     ` Uday Shankar
2025-04-14 11:25 ` [PATCH 3/9] ublk: add ublk_force_abort_dev() Ming Lei
2025-04-14 20:06   ` Uday Shankar
2025-04-14 11:25 ` [PATCH 4/9] ublk: rely on ->canceling for dealing with ublk_nosrv_dev_should_queue_io Ming Lei
2025-04-14 20:15   ` Uday Shankar
2025-04-15  1:48     ` Ming Lei
2025-04-14 11:25 ` [PATCH 5/9] ublk: move device reset into ublk_ch_release() Ming Lei
2025-04-14 20:29   ` Uday Shankar
2025-04-15  1:50     ` Ming Lei
2025-04-14 11:25 ` [PATCH 6/9] ublk: improve detection and handling of ublk server exit Ming Lei
2025-04-14 20:36   ` Uday Shankar
2025-04-15  1:54     ` Ming Lei
2025-04-14 11:25 ` [PATCH 7/9] ublk: remove __ublk_quiesce_dev() Ming Lei
2025-04-14 20:37   ` Uday Shankar [this message]
2025-04-14 11:25 ` [PATCH 8/9] ublk: simplify aborting ublk request Ming Lei
2025-04-14 20:42   ` Uday Shankar
2025-04-14 11:25 ` [PATCH 9/9] selftests: ublk: add generic_06 for covering fault inject Ming Lei
2025-04-14 20:44   ` Uday Shankar
2025-04-15  1:57     ` Ming Lei

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=Z/1yAhw6IZplHTXg@dev-ushankar.dev.purestorage.com \
    --to=ushankar@purestorage.com \
    --cc=axboe@kernel.dk \
    --cc=csander@purestorage.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.