Ian Pratt
2005-Jun-25 01:41 UTC
RE: [Xen-devel] [PATCH] Add DOM0_GETDOMAININFOLIST op for bulkretrieval of domain info
> The attached patch adds a new dom0_op, > DOM0_GETDOMAININFOLIST. This operation allows retrieval of > the domain info structures for all domains in one hypercall. > > Using a small test program, on a system with 97 domains with > non-contiguous domain IDs, I found that with this hypercall I > could retrieve the full array of info structures 12840 times > per second, an improvement from 2380 times per second with > the DOM0_GETDOMAININFO op.Can''t you just reuse the existing xc_getdomain_info function and change the hypercall depending on the number of domains being requested? Ian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2005-Jun-25 09:17 UTC
Re: [Xen-devel] [PATCH] Add DOM0_GETDOMAININFOLIST op for bulkretrieval of domain info
On 25 Jun 2005, at 02:41, Ian Pratt wrote:>> Using a small test program, on a system with 97 domains with >> non-contiguous domain IDs, I found that with this hypercall I >> could retrieve the full array of info structures 12840 times >> per second, an improvement from 2380 times per second with >> the DOM0_GETDOMAININFO op. > > Can''t you just reuse the existing xc_getdomain_info function and change > the hypercall depending on the number of domains being requested?Why not just add nr_doms argument to existing GETDOMAININFO op? Maybe make nr_doms==0 same as nr_doms==1 for backward source compatibility. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Josh Triplett
2005-Jun-27 18:33 UTC
RE: [Xen-devel] [PATCH] Add DOM0_GETDOMAININFOLIST op for bulkretrieval of domain info
On Sat, 2005-06-25 at 02:41 +0100, Ian Pratt wrote:> > The attached patch adds a new dom0_op, > > DOM0_GETDOMAININFOLIST. This operation allows retrieval of > > the domain info structures for all domains in one hypercall. > > > > Using a small test program, on a system with 97 domains with > > non-contiguous domain IDs, I found that with this hypercall I > > could retrieve the full array of info structures 12840 times > > per second, an improvement from 2380 times per second with > > the DOM0_GETDOMAININFO op. > > Can''t you just reuse the existing xc_getdomain_info function and change > the hypercall depending on the number of domains being requested?xc_domain_getinfo? Ideally yes. However, xc_domain_getinfo performs a translation from the xc_domaininfo_t structure (a typedef of dom0_getdomaininfo_t) returned by DOM0_GETDOMAININFO to the array of xc_dominfo_t structures passed by the caller. So in order to use the bulk call from xc_domain_getinfo, it would need to allocate its own array of xc_domaininfo_t structures, make the hypercall, and then perform the translation on the array of structures. If xc_domain_getinfo took a caller-provided array of xc_domaininfo_t structures, I would definitely have just modified it to use the new hypercall rather than making a new function. What is the purpose of that translation from one structure to the other? The only differences seem to be reordered/renamed fields, and splitting the flags field out into individual bitfields. If that is the only purpose, then why not just have xc_domaininfo_t include a union of the flags field and a structure containing a bitfield? - Josh Triplett _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Josh Triplett
2005-Jun-27 18:33 UTC
Re: [Xen-devel] [PATCH] Add DOM0_GETDOMAININFOLIST op for bulkretrieval of domain info
On Sat, 2005-06-25 at 10:17 +0100, Keir Fraser wrote:> On 25 Jun 2005, at 02:41, Ian Pratt wrote: > > >> Using a small test program, on a system with 97 domains with > >> non-contiguous domain IDs, I found that with this hypercall I > >> could retrieve the full array of info structures 12840 times > >> per second, an improvement from 2380 times per second with > >> the DOM0_GETDOMAININFO op. > > > > Can''t you just reuse the existing xc_getdomain_info function and change > > the hypercall depending on the number of domains being requested? > > Why not just add nr_doms argument to existing GETDOMAININFO op? > Maybe make nr_doms==0 same as nr_doms==1 for backward source > compatibility.DOM0_GETDOMAININFO only includes one dom0_getdomaininfo_t structure, not a pointer to an array of such structures (and the length of that array), so the operation would have no place to store the data. - Josh Triplett _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Josh Triplett
2005-Jun-30 20:37 UTC
RE: [Xen-devel] [PATCH] Add DOM0_GETDOMAININFOLIST op for bulkretrieval of domain info
On Mon, 2005-06-27 at 11:33 -0700, Josh Triplett wrote:> On Sat, 2005-06-25 at 02:41 +0100, Ian Pratt wrote: > > > The attached patch adds a new dom0_op, > > > DOM0_GETDOMAININFOLIST. This operation allows retrieval of > > > the domain info structures for all domains in one hypercall. > > > > > > Using a small test program, on a system with 97 domains with > > > non-contiguous domain IDs, I found that with this hypercall I > > > could retrieve the full array of info structures 12840 times > > > per second, an improvement from 2380 times per second with > > > the DOM0_GETDOMAININFO op. > > > > Can''t you just reuse the existing xc_getdomain_info function and change > > the hypercall depending on the number of domains being requested? > > xc_domain_getinfo? Ideally yes. However, xc_domain_getinfo performs a > translation from the xc_domaininfo_t structure (a typedef of > dom0_getdomaininfo_t) returned by DOM0_GETDOMAININFO to the array of > xc_dominfo_t structures passed by the caller. So in order to use the > bulk call from xc_domain_getinfo, it would need to allocate its own > array of xc_domaininfo_t structures, make the hypercall, and then > perform the translation on the array of structures. If > xc_domain_getinfo took a caller-provided array of xc_domaininfo_t > structures, I would definitely have just modified it to use the new > hypercall rather than making a new function. > > What is the purpose of that translation from one structure to the other? > The only differences seem to be reordered/renamed fields, and splitting > the flags field out into individual bitfields. If that is the only > purpose, then why not just have xc_domaininfo_t include a union of the > flags field and a structure containing a bitfield?Looking at the Python bindings, I see that they make use of this split-out structure to more easily fill the equivalent Python data structure. Would it help to provide a patch which would change the python bindings to call xc_domain_getinfolist and deal with xc_domaininfo_t (aka dom0_getdomaininfo_t) directly (possibly modifying dom0_getdomaininfo_t to contain something like a union of the flags and a split-out bitfield structure)? With that change, xc_domain_getinfo could then become a backward-compatibility function; it could also optionally be changed to fetch domain information in chunks using DOM0_GETINFOLIST. Also, is it acceptable for libxc to make use of unnamed unions and unnamed structs as structure members? - Josh Triplett _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel