All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, "Ewan D . Milne" <emilne@redhat.com>,
	Hannes Reinecke <hare@suse.com>, Christoph Hellwig <hch@lst.de>,
	Mike Snitzer <snitzer@redhat.com>,
	dm-devel@redhat.com, stable@vger.kernel.org
Subject: Re: [PATCH V2 1/2] blk-mq: add callback of .cleanup_rq
Date: Tue, 23 Jul 2019 09:00:55 +0800	[thread overview]
Message-ID: <20190723010053.GA30776@ming.t460p> (raw)
In-Reply-To: <4ffe9dd8-9e86-fd93-828e-78c1e5931c5f@acm.org>

On Mon, Jul 22, 2019 at 09:51:27AM -0700, Bart Van Assche wrote:
> On 7/19/19 8:06 PM, Ming Lei wrote:
> > diff --git a/block/blk-mq.c b/block/blk-mq.c
> > index b038ec680e84..fc38d95c557f 100644
> > --- a/block/blk-mq.c
> > +++ b/block/blk-mq.c
> > @@ -502,6 +502,9 @@ void blk_mq_free_request(struct request *rq)
> >   	struct blk_mq_ctx *ctx = rq->mq_ctx;
> >   	struct blk_mq_hw_ctx *hctx = rq->mq_hctx;
> > +	if (q->mq_ops->cleanup_rq)
> > +		q->mq_ops->cleanup_rq(rq);
> > +
> >   	if (rq->rq_flags & RQF_ELVPRIV) {
> >   		if (e && e->type->ops.finish_request)
> >   			e->type->ops.finish_request(rq);
> 
> I'm concerned about the performance impact of this change. How about not

Not see any performance impact in my test, and q->mq_ops should be in
data cache at that time.

> introducing .cleanup_rq() and adding a call to
> scsi_mq_uninit_cmd() in scsi_queue_rq() just before that function returns
> BLK_STS_RESOURCE or BLK_STS_DEV_RESOURCE?

The problem is that only dm-rq needs to free the request private data
when BLK_STS_RESOURCE or BLK_STS_DEV_RESOURCE is returned. If we do that
unconditionally, performance impact might be visible.


Thanks,
Ming

  reply	other threads:[~2019-07-23  1:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-20  3:06 [PATCH V2 0/2] block/scsi/dm-rq: fix leak of request private data in dm-mpath Ming Lei
2019-07-20  3:06 ` [PATCH V2 1/2] blk-mq: add callback of .cleanup_rq Ming Lei
2019-07-20 12:23   ` Sasha Levin
2019-07-22 16:51   ` Bart Van Assche
2019-07-23  1:00     ` Ming Lei [this message]
2019-07-20  3:06 ` [PATCH V2 2/2] scsi: implement .cleanup_rq callback Ming Lei
2019-07-22 15:40   ` Bart Van Assche
2019-07-23  1:03     ` Ming Lei
2019-07-25 10:46   ` [scsi] ae86a1c553: BUG:kernel_NULL_pointer_dereference,address kernel test robot
2019-07-25 10:46     ` kernel test robot
2019-07-25 10:46     ` [scsi] ae86a1c553: BUG:kernel_NULL_pointer_dereference, address kernel test robot
2019-07-27  2:15     ` [scsi] ae86a1c553: BUG:kernel_NULL_pointer_dereference,address Ming Lei
2019-07-27  2:15       ` [scsi] ae86a1c553: BUG:kernel_NULL_pointer_dereference, address Ming Lei
2019-07-26 16:20 ` [PATCH V2 0/2] block/scsi/dm-rq: fix leak of request private data in dm-mpath Benjamin Block
2019-07-27  2:12   ` 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=20190723010053.GA30776@ming.t460p \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=dm-devel@redhat.com \
    --cc=emilne@redhat.com \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=jejb@linux.ibm.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=snitzer@redhat.com \
    --cc=stable@vger.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 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.