From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Axboe Subject: Re: poor domU VBD performance. Date: Thu, 31 Mar 2005 21:20:10 +0200 Message-ID: <20050331192009.GV9204@suse.de> References: <20050331070514.GH9204@suse.de> <20050331071043.GI9204@suse.de> <63537e2b84ddbba6cb3d970f73c6ab35@cl.cam.ac.uk> <20050331081900.GK9204@suse.de> <20050331143312.GB13179@vienna.egenera.com> <20050331153449.GE12579@tpkurt.garloff.de> <20050331165305.GA13875@vienna.egenera.com> <20050331180151.GT9204@suse.de> <20050331184309.GC13875@vienna.egenera.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Ian Pratt , Philip R Auld , Kurt Garloff , Xen development list , Vincent Hanquez , Christian Limpach List-Id: xen-devel@lists.xenproject.org On Thu, Mar 31 2005, Keir Fraser wrote: > >What I was getting at was that the backend will split requests > >up and issue each physical segment as a separate bio (at least in > >the 2.0.5 tree I have in front of me). And that none of these > >physical segments was more that 1 page. > > > >So the request merging in the back end OS is important, no? > > Ah, this reminds me I have one more question for Jens. > > Since all the bio's that I queue up in a single invocation of > dispatch_rw_block_io() will actually be adjacent to each other (because > they're all from the same scatter-gather list) can I actually do > something like (very roughly): > > bio = bio_alloc(GFP_KERNEL, nr_psegs); > for ( i = 0; i < nr_psegs; i++ ) > bio_add_page(bio, blah...); > submit_bio(operation, bio); > > Each of the biovecs that I queue may not be a full page in size (but > won't straddle a page boundary of course). Yes, this is precisely what you should do, the current method is pretty suboptimal. Basically allocate a bio with nr_psegs, and call bio_add_page() for each page until it returns _less_ than the number of bytes you requested. When it does that, submit that bio for io and allocate a new bio with nr_psegs-submitted_segs bio_vecs attached. Continue until you are done. -- Jens Axboe