linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Ming Lei <ming.lei@redhat.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, Theodore Ts'o <tytso@mit.edu>,
	Omar Sandoval <osandov@fb.com>, Sagi Grimberg <sagi@grimberg.me>,
	Dave Chinner <dchinner@redhat.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	Mike Snitzer <snitzer@redhat.com>,
	dm-devel@redhat.com, Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, linux-raid@vger.kernel.org,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org,
	"Darrick J . Wong" <darrick.wong@oracle.com>,
	linux-xfs@vger.kernel.org, Gao Xiang <gaoxiang25@huawei.com>,
	Christoph Hellwig <hch@lst.de>,
	linux-ext4@vger.kernel.org, Coly Li <colyli@suse.de>,
	linux-bcache@vger.kernel.org, Boaz Harrosh <ooo@electrozaur.com>,
	Bob Peterson <rpeterso@redhat.com>,
	cluster-devel@redhat.com
Subject: Re: [PATCH V13 00/19] block: support multi-page bvec
Date: Mon, 14 Jan 2019 20:44:59 -0700	[thread overview]
Message-ID: <49d610a4-0c2b-f7e7-6505-9dde59343b75@kernel.dk> (raw)
In-Reply-To: <20190111110127.21664-1-ming.lei@redhat.com>

On 1/11/19 4:01 AM, Ming Lei wrote:
> Hi,
> 
> This patchset brings multi-page bvec into block layer:
> 
> 1) what is multi-page bvec?
> 
> Multipage bvecs means that one 'struct bio_bvec' can hold multiple pages
> which are physically contiguous instead of one single page used in linux
> kernel for long time.
> 
> 2) why is multi-page bvec introduced?
> 
> Kent proposed the idea[1] first. 
> 
> As system's RAM becomes much bigger than before, and huge page, transparent
> huge page and memory compaction are widely used, it is a bit easy now
> to see physically contiguous pages from fs in I/O. On the other hand, from
> block layer's view, it isn't necessary to store intermediate pages into bvec,
> and it is enough to just store the physicallly contiguous 'segment' in each
> io vector.
> 
> Also huge pages are being brought to filesystem and swap [2][6], we can
> do IO on a hugepage each time[3], which requires that one bio can transfer
> at least one huge page one time. Turns out it isn't flexiable to change
> BIO_MAX_PAGES simply[3][5]. Multipage bvec can fit in this case very well.
> As we saw, if CONFIG_THP_SWAP is enabled, BIO_MAX_PAGES can be configured
> as much bigger, such as 512, which requires at least two 4K pages for holding
> the bvec table.
> 
> With multi-page bvec:
> 
> - Inside block layer, both bio splitting and sg map can become more
> efficient than before by just traversing the physically contiguous
> 'segment' instead of each page.
> 
> - segment handling in block layer can be improved much in future since it
> should be quite easy to convert multipage bvec into segment easily. For
> example, we might just store segment in each bvec directly in future.
> 
> - bio size can be increased and it should improve some high-bandwidth IO
> case in theory[4].
> 
> - there is opportunity in future to improve memory footprint of bvecs. 
> 
> 3) how is multi-page bvec implemented in this patchset?
> 
> Patch 1 ~ 4 parpares for supporting multi-page bvec. 
> 
> Patches 5 ~ 15 implement multipage bvec in block layer:
> 
> 	- put all tricks into bvec/bio/rq iterators, and as far as
> 	drivers and fs use these standard iterators, they are happy
> 	with multipage bvec
> 
> 	- introduce bio_for_each_bvec() to iterate over multipage bvec for splitting
> 	bio and mapping sg
> 
> 	- keep current bio_for_each_segment*() to itereate over singlepage bvec and
> 	make sure current users won't be broken; especailly, convert to this
> 	new helper prototype in single patch 21 given it is bascially a mechanism
> 	conversion
> 
> 	- deal with iomap & xfs's sub-pagesize io vec in patch 13
> 
> 	- enalbe multipage bvec in patch 14 
> 
> Patch 16 redefines BIO_MAX_PAGES as 256.
> 
> Patch 17 documents usages of bio iterator helpers.
> 
> Patch 18~19 kills NO_SG_MERGE.
> 
> These patches can be found in the following git tree:
> 
> 	git:  https://github.com/ming1/linux.git  for-4.21-block-mp-bvec-V12
> 
> Lots of test(blktest, xfstests, ltp io, ...) have been run with this patchset,
> and not see regression.
> 
> Thanks Christoph for reviewing the early version and providing very good
> suggestions, such as: introduce bio_init_with_vec_table(), remove another
> unnecessary helpers for cleanup and so on.
> 
> Thanks Chritoph and Omar for reviewing V10/V11/V12, and provides lots of
> helpful comments.

Thanks for persisting in this endeavor, Ming, I've applied this for 5.1.

-- 
Jens Axboe


      parent reply	other threads:[~2019-01-15  3:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11 11:01 [PATCH V13 00/19] block: support multi-page bvec Ming Lei
2019-01-11 11:01 ` [PATCH V13 01/19] btrfs: look at bi_size for repair decisions Ming Lei
2019-01-11 11:01 ` [PATCH V13 02/19] block: don't use bio->bi_vcnt to figure out segment number Ming Lei
2019-01-11 11:01 ` [PATCH V13 03/19] block: remove bvec_iter_rewind() Ming Lei
2019-01-11 11:01 ` [PATCH V13 04/19] block: rename bvec helpers Ming Lei
2019-01-11 11:01 ` [PATCH V13 05/19] block: introduce multi-page " Ming Lei
2019-01-11 11:01 ` [PATCH V13 06/19] block: introduce bio_for_each_bvec() and rq_for_each_bvec() Ming Lei
2019-01-11 11:01 ` [PATCH V13 07/19] block: use bio_for_each_bvec() to compute multi-page bvec count Ming Lei
2019-01-11 11:01 ` [PATCH V13 08/19] block: use bio_for_each_bvec() to map sg Ming Lei
2019-01-11 11:01 ` [PATCH V13 09/19] block: introduce bvec_last_segment() Ming Lei
2019-01-11 11:01 ` [PATCH V13 10/19] fs/buffer.c: use bvec iterator to truncate the bio Ming Lei
2019-01-11 11:01 ` [PATCH V13 11/19] btrfs: use bvec_last_segment to get bio's last page Ming Lei
2019-01-11 11:01 ` [PATCH V13 12/19] block: loop: pass multi-page bvec to iov_iter Ming Lei
2019-01-11 11:01 ` [PATCH V13 13/19] bcache: avoid to use bio_for_each_segment_all() in bch_bio_alloc_pages() Ming Lei
2019-01-11 11:01 ` [PATCH V13 14/19] block: allow bio_for_each_segment_all() to iterate over multi-page bvec Ming Lei
2019-01-11 11:01 ` [PATCH V13 15/19] block: enable multipage bvecs Ming Lei
2019-01-11 11:01 ` [PATCH V13 16/19] block: always define BIO_MAX_PAGES as 256 Ming Lei
2019-01-11 11:01 ` [PATCH V13 17/19] block: document usage of bio iterator helpers Ming Lei
2019-01-11 11:01 ` [PATCH V13 18/19] block: kill QUEUE_FLAG_NO_SG_MERGE Ming Lei
2019-01-11 11:01 ` [PATCH V13 19/19] block: kill BLK_MQ_F_SG_MERGE Ming Lei
2019-01-15  3:44 ` Jens Axboe [this message]

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=49d610a4-0c2b-f7e7-6505-9dde59343b75@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=cluster-devel@redhat.com \
    --cc=colyli@suse.de \
    --cc=darrick.wong@oracle.com \
    --cc=dchinner@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=dsterba@suse.com \
    --cc=gaoxiang25@huawei.com \
    --cc=hch@lst.de \
    --cc=kent.overstreet@gmail.com \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=ooo@electrozaur.com \
    --cc=osandov@fb.com \
    --cc=rpeterso@redhat.com \
    --cc=sagi@grimberg.me \
    --cc=snitzer@redhat.com \
    --cc=tytso@mit.edu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).