From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id F074D7F52 for ; Wed, 30 Oct 2013 22:30:54 -0500 (CDT) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id BF25B30405F for ; Wed, 30 Oct 2013 20:30:51 -0700 (PDT) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id fcQD4KV7Su5rhoM5 for ; Wed, 30 Oct 2013 20:30:49 -0700 (PDT) Date: Thu, 31 Oct 2013 14:29:36 +1100 From: NeilBrown Subject: Re: [PATCH 04/23] block: Abstract out bvec iterator Message-ID: <20131031142936.63727342@notabene.brown> In-Reply-To: <1383077896-4132-5-git-send-email-kmo@daterainc.com> References: <1383077896-4132-1-git-send-email-kmo@daterainc.com> <1383077896-4132-5-git-send-email-kmo@daterainc.com> Mime-Version: 1.0 List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============2940621653109245774==" Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Kent Overstreet Cc: Dave Kleikamp , Jeremy Fitzhardinge , Herton Ronaldo Krzesinski , Jan Beulich , "Ed L. Cashin" , "Michael S. Tsirkin" , Benjamin Herrenschmidt , Selvan Mani , Namjae Jeon , Heiko Carstens , Chris Mason , nab@linux-iscsi.org, dm-devel@redhat.com, Paul Mackerras , Pavel Machek , KONISHI Ryusuke , Ian Campbell , Joshua Morris , Alasdair Kergon , Nick Piggin , Roger Pau =?UTF-8?B?TW9ubsOp?= , Joe Perches , Mike Snitzer , Len Brown , Minchan Kim , Jie Liu , Andreas Dilger , Stefano Stabellini , Sebastian Ott , Philip Kelleher , Steven Whitehouse , hch@infradead.org, Christian Borntraeger , Ingo Molnar , Geert Uytterhoeven , Mel Gorman , Boaz Harrosh , Matthew Wilcox , Lars Ellenberg , Ben Hutchings , Prasad Joshi , Nitin Gupta , Alex Elder , Dan Magenheimer , Peng Tao , Sage Weil , Konrad Rzeszutek Wilk , Pankaj Kumar , Trond Myklebust , Joern Engel , Rusty Russell , Steven Rostedt , xfs@oss.sgi.com, "Rafael J. Wysocki" , Martin Schwidefsky , Ben Myers , Jerome Marchand , Alexander Viro , Andy Adamson , Sam Bradshaw , Jaegeuk Kim , ceph-devel@vger.kernel.org, Yehuda Sadeh , axboe@kernel.dk, Theodore Ts'o , Andrew Morton , "Martin K. Petersen" , Sunil Mushran , Geoff Levand , Jiri Kosina , Asai Thambi S P , linux-kernel@vger.kernel.org, "James E.J. Bottomley" , fanchaoting , Benny Halevy , Jiang Liu , Greg Kroah-Hartman , tj@kernel.org, linux390@de.ibm.com, Mark Fasheh , Wei Yongjun , Frederic Weisbecker , Guo Chao , Joel Becker --===============2940621653109245774== Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/bF/+0261ZWlTgozZbA48+3r"; protocol="application/pgp-signature" --Sig_/bF/+0261ZWlTgozZbA48+3r Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 29 Oct 2013 13:17:57 -0700 Kent Overstreet wrot= e: > Immutable biovecs are going to require an explicit iterator. To > implement immutable bvecs, a later patch is going to add a bi_bvec_done > member to this struct; for now, this patch effectively just renames > things. >=20 > Signed-off-by: Kent Overstreet > diff --git a/Documentation/block/biodoc.txt b/Documentation/block/biodoc.= txt > index 8df5e8e..2101e71 100644 > --- a/Documentation/block/biodoc.txt > +++ b/Documentation/block/biodoc.txt > @@ -447,14 +447,13 @@ struct bio_vec { > * main unit of I/O for the block layer and lower layers (ie drivers) > */ > struct bio { > - sector_t bi_sector; > struct bio *bi_next; /* request queue link */ > struct block_device *bi_bdev; /* target device */ > unsigned long bi_flags; /* status, command, etc */ > unsigned long bi_rw; /* low bits: r/w, high: priority= */ > =20 > unsigned int bi_vcnt; /* how may bio_vec's */ > - unsigned int bi_idx; /* current index into bio_vec array */ > + struct bvec_iter bi_iter; /* current index into bio_vec array */ > =20 > unsigned int bi_size; /* total size in bytes */ > unsigned short bi_phys_segments; /* segments after physaddr coal= esce*/ > @@ -480,7 +479,7 @@ With this multipage bio design: > - Code that traverses the req list can find all the segments of a bio > by using rq_for_each_segment. This handles the fact that a request > has multiple bios, each of which can have multiple segments. > -- Drivers which can't process a large bio in one shot can use the bi_idx > +- Drivers which can't process a large bio in one shot can use the bi_iter > field to keep track of the next bio_vec entry to process. > (e.g a 1MB bio_vec needs to be handled in max 128kB chunks for IDE) > [TBD: Should preferably also have a bi_voffset and bi_vlen to avoid mo= difying > @@ -589,7 +588,7 @@ driver should not modify these values. The block laye= r sets up the > nr_sectors and current_nr_sectors fields (based on the corresponding > hard_xxx values and the number of bytes transferred) and updates it on > every transfer that invokes end_that_request_first. It does the same for= the > -buffer, bio, bio->bi_idx fields too. > +buffer, bio, bio->bi_iter fields too. > =20 > The buffer field is just a virtual address mapping of the current segment > of the i/o buffer in cases where the buffer resides in low-memory. For h= igh Would it make sense to add some details of "bvec_iter" to this document? Or will that come later? NeilBrown --Sig_/bF/+0261ZWlTgozZbA48+3r Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQIVAwUBUnHOoDnsnt1WYoG5AQKAog//cNxNO7n4EheLQg3FVtX4edv6npapiTlQ IuJ8LixK5hK5kx0hDsPaK78n6ZLs3DADc6/d3HtLc33L90l2WhWUMm8SiJowacKu HemHPkt/dmUGvCWL1eaoPA2TVAvrIELUCKaMjQOe6s1eAamthbINelirjFtBpj/p bX6KyU/eYMiBrS0QqpXE0oeOnUj1qrC0Too9qCGA9wKL8SIOXB8fZ4+kxi9qyYZk bShLMjvvkouYMq4wSnz9ZdekQIA0XjS8S8ui4idKXzwrXq23aJbJT/JTQ+tprXhN Wa2N4bwo/EI36xIvGsqx1eu1rmOqmYbJNi8rNt9Sbr5CM9tioeq3wkUKOiRMQznx NJnhkvzEhGZ/0IYp19HOSHCQooAE2gOltCHvv24MXks0BUT62w1KS2CKTY5BAsxU 42aEqOXN5XW6hsl1GUz2csJn9/U03s+ifJZn9DlrNvSen7eQfFXXvJeE29JUVtuO i+/ePbxEbLNNGFDLH8qzTTSW+ikV034OljYBXUGtyJAwVzXIsP2kg4tfDAiSRhFk l8qYT8jWHfiknCbn4E0pZd3gcfqBpdk2zNlf7y6PhlDGumP6PCcb5hlSYM7TZK/g Y/xFRdI889P4aEIcePPVKYBcBFdcrj6SDvqp3S+G8MZgcvsQAv20MxqKPpESUVrT CTs9IhepD+0= =7uUB -----END PGP SIGNATURE----- --Sig_/bF/+0261ZWlTgozZbA48+3r-- --===============2940621653109245774== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs --===============2940621653109245774==--