From: Bart Van Assche <bvanassche@acm.org>
To: Ming Lei <ming.lei@redhat.com>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
linux-scsi@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-block@vger.kernel.org,
Dongli Zhang <dongli.zhang@oracle.com>,
James Smart <james.smart@broadcom.com>,
Bart Van Assche <bart.vanassche@wdc.com>,
Christoph Hellwig <hch@lst.de>,
jianchao wang <jianchao.w.wang@oracle.com>
Subject: Re: [PATCH] SCSI: don't hold device refcount in IO path
Date: Tue, 02 Apr 2019 08:51:34 -0700 [thread overview]
Message-ID: <1554220294.118779.142.camel@acm.org> (raw)
In-Reply-To: <20190402114800.2281-1-ming.lei@redhat.com>
On Tue, 2019-04-02 at 19:48 +0800, Ming Lei wrote:
> scsi_device's refcount is always grabed in IO path.
^^^^^^
grabbed?
> Turns out it isn't necessary, becasue blk_queue_cleanup() will
> drain any in-flight IOs, then cancel timeout/requeue work, and
> SCSI's requeue_work is canceled too in __scsi_remove_device().
>
> Also scsi_device won't go away until blk_cleanup_queue() is done.
>
> So don't hold the refcount in IO path.
Holding the device reference count was definitely necessary in the past.
You may want to reflect this in the patch description by mentioning that
grabbing that reference count is no longer required today because the
draining mechanism now waits for requeuing to occur. I don't think that
was the case for the legacy block layer.
Bart.
next prev parent reply other threads:[~2019-04-02 15:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-02 11:48 [PATCH] SCSI: don't hold device refcount in IO path Ming Lei
2019-04-02 15:13 ` Bart Van Assche
2019-04-02 15:51 ` Bart Van Assche [this message]
2019-04-03 3:41 ` Ming Lei
2019-04-03 4:00 ` Bart Van Assche
2019-04-03 4:25 ` Dongli Zhang
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=1554220294.118779.142.camel@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=bart.vanassche@wdc.com \
--cc=dongli.zhang@oracle.com \
--cc=hch@lst.de \
--cc=james.smart@broadcom.com \
--cc=jianchao.w.wang@oracle.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@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.