public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Ming Lei <ming.lei@canonical.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 4/6] virtio-blk: implement init_flush_rq
Date: Sun, 7 Sep 2014 20:52:59 +0200	[thread overview]
Message-ID: <20140907185259.GC23026@lst.de> (raw)
In-Reply-To: <1410079162-9872-5-git-send-email-ming.lei@canonical.com>

A couple comments not directly related to this patch, it's just
a convenient vehicle for my rants :)

> @@ -556,6 +555,19 @@ static int virtblk_init_request(void *data, struct request *rq,
>  	struct virtio_blk *vblk = data;
>  	struct virtblk_req *vbr = blk_mq_rq_to_pdu(rq);
>  
> +	vbr->req = rq;

I really hate how we need these backpointers in most drivers.  Given
that struct request and the driver privata data are allocated together
we should be able to do this with simple pointer arithmetics.

> +	sg_init_table(vbr->sg, vblk->sg_elems);

Jens, what do you think about moving of the SG list handling to the
core block layer?  I'd really like to have the S/G list in struct request,
and if we do that we could also take the scsi-mq code that allows small
S/G lists preallocated in blk-mq and allocating larger ones at runtime
there, avoiding the need to duplicate that code and the whole mempool
magic it requires in drivers that want to make use of it.


  reply	other threads:[~2014-09-07 18:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-07  8:39 [PATCH 0/6] blk-mq: initialize pdu of flush req explicitly Ming Lei
2014-09-07  8:39 ` [PATCH 1/6] blk-mq: allocate flush_rq in blk_mq_init_flush() Ming Lei
2014-09-07  8:39 ` [PATCH 2/6] blk-mq: introduce init_flush_rq callback and its pair Ming Lei
2014-09-07  8:39 ` [PATCH 3/6] blk-mq: don't copy pdu if init_flush_rq is implemented Ming Lei
2014-09-07  8:39 ` [PATCH 4/6] virtio-blk: implement init_flush_rq Ming Lei
2014-09-07 18:52   ` Christoph Hellwig [this message]
2014-09-07  8:39 ` [PATCH 5/6] scsi-lib: implement init_flush_rq and its pair Ming Lei
2014-09-07 18:53   ` Christoph Hellwig
2014-09-07  8:39 ` [PATCH 6/6] blk-mq: don't copy pdu any more for flush req Ming Lei
2014-09-07 18:49 ` [PATCH 0/6] blk-mq: initialize pdu of flush req explicitly Christoph Hellwig
2014-09-08 16:55   ` Ming Lei
2014-09-08 19:03     ` Jens Axboe
2014-09-08 22:53     ` Elliott, Robert (Server Storage)

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=20140907185259.GC23026@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ming.lei@canonical.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox