All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Ming Lei <ming.lei@canonical.com>
Cc: Christoph Hellwig <hch@lst.de>, Al Viro <viro@zeniv.linux.org.uk>,
	Jens Axboe <axboe@fb.com>,
	Nicholas Bellinger <nab@linux-iscsi.org>,
	Linux FS Devel <linux-fsdevel@vger.kernel.org>,
	target-devel@vger.kernel.org
Subject: Re: [PATCH 3/3] target: use vfs_bvec_read/write
Date: Mon, 26 Jan 2015 17:59:12 +0100	[thread overview]
Message-ID: <20150126165912.GA13669@lst.de> (raw)
In-Reply-To: <CACVXFVNMLQAVn3fCXaRG1JoRZ8Y_b3kAOjWh0yicrO9VMJu3uw@mail.gmail.com>

On Mon, Jan 26, 2015 at 10:02:30AM +0800, Ming Lei wrote:
> >> Sorry, I have one question: I understand one bvec should only cover
> >> one page, but
> >> one sg may cover lots of pages, so could ITER_BVEC handle that correctly?
> >
> > Each scatterlist entry only contains a single page, which is returned
> 
> I mean scatterlist does not guarantee that, and one sg entry often
> contains lots of pages, which DMA/bus address is continuous.

But we still get away with using page_address(), so from the VM
point of view that matters here it's the same as a single high order
page.

> > by sg_page(sg).  The existing code already relies on it because it
> > kmaps that page.
> 
> If the existing target code path can guarantee that one sg entry
> only contains one page, it should be better to use bio_vec explicitly
> instead of scatterlist.

While it allocates a single page per SGL entry (see target_alloc_sgl),
it uses the scatterlist to allow drivers to dma map it for hardware
access, so a scatterlist seems useful here.

  reply	other threads:[~2015-01-26 16:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-18 15:07 switch loop and target to use ITER_BVEC iov_iter Christoph Hellwig
2015-01-18 15:07 ` [PATCH 1/3] fs: add vfs_bvec_{read,write} helpers Christoph Hellwig
2015-01-23  6:00   ` Al Viro
2015-01-18 15:07 ` [PATCH 2/3] loop: convert to vfs_bvec_write Christoph Hellwig
2015-01-18 15:07 ` [PATCH 3/3] target: use vfs_bvec_read/write Christoph Hellwig
2015-01-18 15:37   ` Sagi Grimberg
2015-01-20 23:32   ` Nicholas A. Bellinger
2015-01-23 14:08   ` Ming Lei
2015-01-25 13:43     ` Christoph Hellwig
2015-01-26  2:02       ` Ming Lei
2015-01-26 16:59         ` Christoph Hellwig [this message]
2015-01-27  5:14           ` Ming Lei
2015-01-22  4:11 ` switch loop and target to use ITER_BVEC iov_iter Ming Lei
2015-01-25 13:45   ` 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=20150126165912.GA13669@lst.de \
    --to=hch@lst.de \
    --cc=axboe@fb.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=ming.lei@canonical.com \
    --cc=nab@linux-iscsi.org \
    --cc=target-devel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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.