linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Shaohua Li <shli@fb.com>
Cc: linux-ide@vger.kernel.org, Kernel-team@fb.com,
	Jens Axboe <axboe@fb.com>, Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH 2/2] libata: use generic taging
Date: Mon, 15 Dec 2014 00:13:18 -0800	[thread overview]
Message-ID: <20141215081318.GB3982@infradead.org> (raw)
In-Reply-To: <fe6c323e2127bb4a89c4a4f85e5d131bba355a05.1418613253.git.shli@fb.com>

> +struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev, int tag)
>  {
>  	struct ata_port *ap = dev->link->ap;
>  	struct ata_queued_cmd *qc;
>  
> +	/* no command while frozen */
> +	if (unlikely(ap->pflags & ATA_PFLAG_FROZEN))
> +		return NULL;
>  
> +	qc = __ata_qc_from_tag(ap, tag);

It would be more useful to allocate the ata_queued_cmd as part of
the request/scsi_cmnd, and dip into the reserved pool for internal
commands.

Also note that tags are per-host which probably breaks the indexing 
scheme to look up the commands from ap->qcmd.

> @@ -3711,6 +3711,8 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync)
>  						 NULL);
>  			if (!IS_ERR(sdev)) {
>  				dev->sdev = sdev;
> +				blk_queue_resize_tags(sdev->request_queue,
> +					ap->host->n_tags);

Never call blk_queue_resize_tags directly from a SCSI LLDD, and use
the scsi_change_queue_depth API instead.  Also remember that for
blk-mq you can't grow the tag map after allocation.


  reply	other threads:[~2014-12-15  8:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-15  3:21 [PATCH 1/2] block: support different tag allocation policy Shaohua Li
2014-12-15  3:21 ` [PATCH 2/2] libata: use generic taging Shaohua Li
2014-12-15  8:13   ` Christoph Hellwig [this message]
2014-12-15  8:08 ` [PATCH 1/2] block: support different tag allocation policy Christoph Hellwig
2014-12-15 16:24   ` Shaohua Li
2014-12-15 16:57     ` Christoph Hellwig

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=20141215081318.GB3982@infradead.org \
    --to=hch@infradead.org \
    --cc=Kernel-team@fb.com \
    --cc=axboe@fb.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=shli@fb.com \
    --cc=tj@kernel.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 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).