Linux-Block Archive on
 help / color / Atom feed
From: Jens Axboe <>
To: Christoph Hellwig <>
Subject: Re: fix nr_phys_segments vs iterators accounting v3
Date: Tue, 21 May 2019 06:47:07 -0600
Message-ID: <> (raw)
In-Reply-To: <>

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Block Archive on

Archives are clonable:
	git clone --mirror 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/ \
	public-inbox-index linux-block

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox