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

Re: [Xen-devel] [PATCH v6 07/11] xen: introduce rangeset_consume_ranges



On Thu, Sep 21, 2017 at 02:53:54PM +0100, Wei Liu wrote:
> On Tue, Sep 19, 2017 at 04:29:32PM +0100, Roger Pau Monne wrote:
> > This function allows to iterate over a rangeset while removing the
> > processed regions.
> > 
> > It will be used by the following patches in order to store memory
> > regions in rangesets, and remove them while iterating.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> > ---
> > Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
> > Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> > Cc: Jan Beulich <jbeulich@xxxxxxxx>
> > Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> > Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> > Cc: Tim Deegan <tim@xxxxxxx>
> > Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
> > ---
> > Changes since v5:
> >  - New in this version.
> > ---
> >  xen/common/rangeset.c      | 28 ++++++++++++++++++++++++++++
> >  xen/include/xen/rangeset.h |  4 ++++
> >  2 files changed, 32 insertions(+)
> > 
> > diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
> > index 6c6293c15c..fd4a6b3384 100644
> > --- a/xen/common/rangeset.c
> > +++ b/xen/common/rangeset.c
> > @@ -298,6 +298,34 @@ int rangeset_report_ranges(
> >      return rc;
> >  }
> 
> I think you need to document the behaviour of this new function due to
> its destructive nature.
> 
> Something like:
> 
> Iterate through the range within a range set. Call cb on each range
> provided. Bail on first error. Destroy the range processed when cb
> has consumed the whole range.

OK, I thought that the 'consume' in the name was enough, but now that
you have written the comment I certainly don't mind adding it ;).

> Though without reading further I don't know why cb will only consume
> part of the range but not all of it all the time.

I guess you have to look at the next patch and it's usage. This will
be used to store all the MMIO areas that need to be mapped into a
domain p2m.

Some of the ranges might be very big (BARs from gfx cards for
example), and might require preemption in order to map them, hence the
emulated PCI code needs a way to store it's progress, and that's done
by partially consuming a range.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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