Linux-Block Archive on lore.kernel.org
 help / color / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Christoph Hellwig <hch@lst.de>
Cc: ming.lei@redhat.com, linux-block@vger.kernel.org
Subject: Re: fix nr_phys_segments vs iterators accounting v3
Date: Tue, 21 May 2019 06:47:07 -0600
Message-ID: <b3a63583-fdcd-6b7b-f80a-e3a0b9b54397@kernel.dk> (raw)
In-Reply-To: <20190521070143.22631-1-hch@lst.de>

On 5/21/19 1:01 AM, Christoph Hellwig wrote:
> Hi all,
> 
> we have had a problem for a while where the number of segments that
> the bvec iterators will iterate over don't match the value in
> req->nr_phys_segments, causing problems for anyone looking at
> nr_phys_segments and iterating over bvec directly instead of using
> blk_rq_map_sg.  The first patch in this series fixes this by
> making sure nr_phys_segments matches the actual number of segments.
> Drivers using blk_rq_map_sg will still get the lower number returned
> from function eventually, but the fact that we don't reduce the
> value earlier will not allow some merges that we might otherwise
> allow.
> 
> With that in place I also noticed that we do not properly account
> segements sizes on devices with a virt_boundary, but it turns out that
> segment sizes fundamentally don't make sense for such devices, as their
> "segment" is a fixed size "device page", and not a variable sized
> scatter/gather elements as in the block layer, so we make that fact
> formal.
> 
> Once all that is sorted out it is pretty clear that there is no
> good reason to have the front/back segement accounting to start
> with.

Applied, thanks.

-- 
Jens Axboe


      parent reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-21  7:01 Christoph Hellwig
2019-05-21  7:01 ` [PATCH 1/4] block: don't decrement nr_phys_segments for physically contigous segments Christoph Hellwig
2019-05-21  8:05   ` Ming Lei
2019-05-21  7:01 ` [PATCH 2/4] block: force an unlimited segment size on queues with a virt boundary Christoph Hellwig
2019-05-21  7:01 ` [PATCH 3/4] block: remove the segment size check in bio_will_gap Christoph Hellwig
2019-05-21  7:01 ` [PATCH 4/4] block: remove the bi_seg_{front,back}_size fields in struct bio Christoph Hellwig
2019-05-21  8:06   ` Ming Lei
2019-05-21 12:47 ` Jens Axboe [this message]

Reply instructions:

You may reply publically 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=b3a63583-fdcd-6b7b-f80a-e3a0b9b54397@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --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

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org linux-block@archiver.kernel.org
	public-inbox-index linux-block


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/ public-inbox