All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Mike Christie <michael.christie@oracle.com>
Cc: Chaitanya.Kulkarni@wdc.com, loberman@redhat.com,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	target-devel@vger.kernel.org, mst@redhat.com,
	stefanha@redhat.com, virtualization@lists.linux-foundation.org
Subject: Re: [PATCH 11/13] target: replace work per cmd in completion path
Date: Wed, 10 Feb 2021 08:42:41 +0000	[thread overview]
Message-ID: <20210210084241.GE2045726@infradead.org> (raw)
In-Reply-To: <20210209123845.4856-12-michael.christie@oracle.com>

On Tue, Feb 09, 2021 at 06:38:43AM -0600, Mike Christie wrote:
> Doing a work per cmd can lead to lots of threads being created.
> This patch just replaces the completion work per cmd with a per cpu
> list. Combined with the first patches this allows tcm loop on top of
> initiators like iser to go from around 700K IOPs to 1000K and reduces
> the number of threads that get created when the system is under heavy
> load and hitting the initiator drivers tagging limits.

OTOH it does increase completion latency, which might be the preference
for some workloads.  Do we need a tunable here?

> +static void target_queue_cmd_work(struct se_cmd_queue *q, struct se_cmd *se_cmd,
> +				  int cpu, struct workqueue_struct *wq)
>  {
> -	struct se_cmd *cmd = container_of(work, struct se_cmd, work);
> +	llist_add(&se_cmd->se_cmd_list, &q->cmd_list);
> +	queue_work_on(cpu, wq, &q->work);
> +}

Do we need this helper at all?  Having it open coded in the two callers
would seem easier to follow to me.


WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@infradead.org>
To: Mike Christie <michael.christie@oracle.com>
Cc: loberman@redhat.com, Chaitanya.Kulkarni@wdc.com,
	martin.petersen@oracle.com, mst@redhat.com,
	virtualization@lists.linux-foundation.org,
	target-devel@vger.kernel.org, stefanha@redhat.com,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 11/13] target: replace work per cmd in completion path
Date: Wed, 10 Feb 2021 08:42:41 +0000	[thread overview]
Message-ID: <20210210084241.GE2045726@infradead.org> (raw)
In-Reply-To: <20210209123845.4856-12-michael.christie@oracle.com>

On Tue, Feb 09, 2021 at 06:38:43AM -0600, Mike Christie wrote:
> Doing a work per cmd can lead to lots of threads being created.
> This patch just replaces the completion work per cmd with a per cpu
> list. Combined with the first patches this allows tcm loop on top of
> initiators like iser to go from around 700K IOPs to 1000K and reduces
> the number of threads that get created when the system is under heavy
> load and hitting the initiator drivers tagging limits.

OTOH it does increase completion latency, which might be the preference
for some workloads.  Do we need a tunable here?

> +static void target_queue_cmd_work(struct se_cmd_queue *q, struct se_cmd *se_cmd,
> +				  int cpu, struct workqueue_struct *wq)
>  {
> -	struct se_cmd *cmd = container_of(work, struct se_cmd, work);
> +	llist_add(&se_cmd->se_cmd_list, &q->cmd_list);
> +	queue_work_on(cpu, wq, &q->work);
> +}

Do we need this helper at all?  Having it open coded in the two callers
would seem easier to follow to me.

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  parent reply	other threads:[~2021-02-10  8:49 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 12:38 [PATCH 00/12 V2] target: fix cmd plugging and completion Mike Christie
2021-02-09 12:38 ` [PATCH 01/13] target: move t_task_cdb initialization Mike Christie
2021-02-10  8:35   ` Christoph Hellwig
2021-02-10  8:35     ` Christoph Hellwig
2021-02-09 12:38 ` [PATCH 02/13] target: split target_submit_cmd_map_sgls Mike Christie
2021-02-09 16:15   ` kernel test robot
2021-02-09 16:15     ` kernel test robot
2021-02-09 16:15     ` kernel test robot
2021-02-09 18:40     ` Mike Christie
2021-02-09 18:40       ` Mike Christie
2021-02-10  8:36   ` Christoph Hellwig
2021-02-10  8:36     ` Christoph Hellwig
2021-02-09 12:38 ` [PATCH 03/13] target: add workqueue based cmd submission Mike Christie
2021-02-09 15:48   ` Bodo Stroesser
2021-02-09 18:43     ` Mike Christie
2021-02-09 19:10       ` Mike Christie
2021-02-09 12:38 ` [PATCH 04/13] vhost scsi: use lio wq cmd submission helper Mike Christie
2021-02-09 12:38 ` [PATCH 05/13] tcm loop: use blk cmd allocator for se_cmds Mike Christie
2021-02-10  8:37   ` Christoph Hellwig
2021-02-10  8:37     ` Christoph Hellwig
2021-02-09 12:38 ` [PATCH 06/13] tcm loop: use lio wq cmd submission helper Mike Christie
2021-02-09 15:59   ` Bodo Stroesser
2021-02-09 18:44     ` Mike Christie
2021-02-09 17:39   ` kernel test robot
2021-02-09 17:39     ` kernel test robot
2021-02-09 12:38 ` [PATCH 07/13] target: cleanup cmd flag bits Mike Christie
2021-02-10  8:38   ` Christoph Hellwig
2021-02-10  8:38     ` Christoph Hellwig
2021-02-09 12:38 ` [PATCH 08/13] target: fix backend plugging Mike Christie
2021-02-09 12:38 ` [PATCH 09/13] target iblock: add backend plug/unplug callouts Mike Christie
2021-02-09 12:38 ` [PATCH 10/13] target_core_user: " Mike Christie
2021-02-09 16:32   ` Bodo Stroesser
2021-02-09 18:59     ` Mike Christie
2021-02-09 12:38 ` [PATCH 11/13] target: replace work per cmd in completion path Mike Christie
2021-02-09 17:01   ` Bodo Stroesser
2021-02-09 18:50     ` Mike Christie
2021-02-10  8:42   ` Christoph Hellwig [this message]
2021-02-10  8:42     ` Christoph Hellwig
2021-02-10 18:33     ` Mike Christie
2021-02-09 12:38 ` [PATCH 12/13] target, vhost-scsi: don't switch cpus on completion Mike Christie
2021-02-10  8:44   ` Christoph Hellwig
2021-02-10  8:44     ` Christoph Hellwig
2021-02-10 18:43     ` Mike Christie
2021-02-10 18:45       ` Mike Christie
2021-02-09 12:38 ` [PATCH 13/13] target: flush submission work during TMR processing Mike Christie
2021-02-09 14:31   ` Laurence Oberman
2021-02-10 14:25     ` Laurence Oberman
2021-02-09 17:05   ` Bodo Stroesser
2021-02-09 18:49     ` Mike Christie
2021-02-10  4:55 [PATCH 00/13 V3] target: fix cmd plugging and completion Mike Christie
2021-02-10  4:55 ` [PATCH 11/13] target: replace work per cmd in completion path Mike Christie

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=20210210084241.GE2045726@infradead.org \
    --to=hch@infradead.org \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=loberman@redhat.com \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    --cc=mst@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=target-devel@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.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 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.