[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 4 of 4 v2] blkif.h: Define and document the request number/size/segments extension



On Feb 16, 2012, at 1:42 AM, Jan Beulich wrote:

> >>> On 15.02.12 at 06:06, "Justin T. Gibbs" <justing@xxxxxxxxxxxxxxxx> wrote:
> > Note: As of __XEN_INTERFACE_VERSION__ 0x00040201 the definition of
> >      BLKIF_MAX_SEGMENTS_PER_REQUEST has changed.  Drivers must be updated
> >      to, at minimum, use BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK, before being
> >      recompiled with a __XEN_INTERFACE_VERSION greater than or equal to
> >      this value.
> > 
> > This extension first appeared in the FreeBSD Operating System.
>
> Any pointer to their implementation?

http://svnweb.freebsd.org/base/head/sys/dev/xen/

...

> > + * max-request-segments
> > + *      Values:         <uint8_t>
> > + *      Default Value:  BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK
> > + *      Maximum Value:  BLKIF_MAX_SEGMENTS_PER_REQUEST
> > + *
> > + *      The maximum value of blkif_request.nr_segments supported by
> > + *      the backend.
> > + *
> > + * max-request-size
> > + *      Values:         <uint32_t>
> > + *      Default Value:  BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK * PAGE_SIZE
> > + *      Maximum Value:  BLKIF_MAX_SEGMENTS_PER_REQUEST * PAGE_SIZE
>
> In particular, wrt the question about a reference to their implementation,
> I don't see why both max-request-segments and max-request-size are
> necessary here and below. What is the intended behavior when the two
> aren't in sync?

The resources needed to deal with fragmentation and overall I/O
request size are distinct.  The goal of the interface is to explicity
indicate both the maximum size and maximum fragmentation (i.e. how
many underutilized segments are allowed) for an I/O.

The FreeBSD block front implementation reserves an extra segment
so that a maximum sized I/O can be transferred even if it does not
start on a page boundary.  I can imagine many reasons why a customized
system may need to handle much higher fragmentation levels.  "Over
provising" the segment count means you can handle this without a
copy to coalesce the fragments.

> > @@ -239,6 +265,33 @@
> >  *      The size of the frontend allocated request ring buffer in units of
> >  *      machine pages.  The value must be a power of 2.
> >  *
> > + * max-requests
> > + *      Values:         <uint32_t>
> > + *      Default Value:  BLKIF_MAX_RING_REQUESTS(PAGE_SIZE)
> > + *      Maximum Value:  BLKIF_MAX_RING_REQUESTS(PAGE_SIZE * max-ring_pages)
> > 
>
> max-ring-pages?

Yes.  Nice catch.

--
Justin


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.