All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Mike Christie <michael.christie@oracle.com>,
	lduncan@suse.com, cleech@redhat.com, ming.lei@redhat.com,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	james.bottomley@hansenpartnership.com
Subject: Re: [RFC PATCH 1/4] scsi: Allow drivers to set BLK_MQ_F_BLOCKING
Date: Mon, 7 Mar 2022 20:57:22 -0800	[thread overview]
Message-ID: <0bf6124e-be6c-aa35-2a54-bc1fa5894a2d@acm.org> (raw)
In-Reply-To: <20220308003957.123312-2-michael.christie@oracle.com>

On 3/7/22 16:39, Mike Christie wrote:
> The software iscsi driver's queuecommand can block and taking the extra
> hop from kblockd to its workqueue results in a performance hit. Allowing
> it to set BLK_MQ_F_BLOCKING and transmit from that context directly
> results in a 20-30% improvement in IOPs for workloads like: [...]

That's impressive!

> @@ -2952,8 +2954,8 @@ scsi_host_block(struct Scsi_Host *shost)
>   	}
>   
>   	/*
> -	 * SCSI never enables blk-mq's BLK_MQ_F_BLOCKING flag so
> -	 * calling synchronize_rcu() once is enough.
> +	 * Drivers that use this helper enable blk-mq's BLK_MQ_F_BLOCKING flag
> +	 * so calling synchronize_rcu() once is enough.
>   	 */
>   	WARN_ON_ONCE(shost->tag_set.flags & BLK_MQ_F_BLOCKING);

s/enable/do not set/ ?

> diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
> index 72e1a347baa6..0d106dc9309d 100644
> --- a/include/scsi/scsi_host.h
> +++ b/include/scsi/scsi_host.h
> @@ -75,6 +75,10 @@ struct scsi_host_template {
>   	 */
>   	int (* queuecommand)(struct Scsi_Host *, struct scsi_cmnd *);
>   
> +	/*
> +	 * Set To true if the queuecommand function can block.
> +	 */
> +	bool queuecommand_blocks;
>   	/*
>   	 * The commit_rqs function is used to trigger a hardware
>   	 * doorbell after some requests have been queued with

I'm not sure what the best name is for this new flag. Some function 
names refer to sleeping (e.g. might_sleep()) while the flag 
BLK_MQ_F_BLOCKING has "blocking" in its name. Although I do not have a 
strong opinion about this: has it been considered to use a name like 
queuecommand_sleeps or queuecommand_may_sleep instead of 
queuecommand_blocks?

Thanks,

Bart.

  reply	other threads:[~2022-03-08  4:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08  0:39 [RFC PATCH 0/4] scsi/iscsi: Send iscsi data from kblockd Mike Christie
2022-03-08  0:39 ` [RFC PATCH 1/4] scsi: Allow drivers to set BLK_MQ_F_BLOCKING Mike Christie
2022-03-08  4:57   ` Bart Van Assche [this message]
2022-03-09  0:53   ` Ming Lei
2022-03-09  1:17     ` Mike Christie
2022-03-09  1:43       ` Ming Lei
2022-03-09 19:38         ` Mike Christie
2022-03-08  0:39 ` [RFC PATCH 2/4] scsi: iscsi: Tell drivers when we must not block Mike Christie
2022-03-08  4:59   ` Bart Van Assche
2022-03-08 15:58     ` Mike Christie
2022-03-08  0:39 ` [RFC PATCH 3/4] scsi: iscsi: Support transmit from queuecommand Mike Christie
2022-03-08  0:39 ` [RFC PATCH 4/4] scsi: iscsi_tcp: Allow user to control if " Mike Christie
2022-03-08  5:10   ` Bart Van Assche
2022-03-08 16:51     ` Mike Christie
     [not found] ` <CGME20220308004023epcas2p12ebd497c14d32f36d0aa6682c0b9d0db@epcms2p7>
2022-03-08  7:00   ` [RFC PATCH 1/4] scsi: Allow drivers to set BLK_MQ_F_BLOCKING Daejun Park
2022-03-08 16:14     ` Mike Christie
2022-03-15  8:26 ` [RFC PATCH 0/4] scsi/iscsi: Send iscsi data from kblockd Christoph Hellwig
2022-03-16  1:08   ` 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=0bf6124e-be6c-aa35-2a54-bc1fa5894a2d@acm.org \
    --to=bvanassche@acm.org \
    --cc=cleech@redhat.com \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=lduncan@suse.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    --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.