Duan, Ronghui
2008-Feb-26 02:02 UTC
[Xen-devel] [PATCH]Add free memory size of every NUMA node in phsical info
Returns free memory size per node in "xm info". This info can help users who want to bind their guest domain in one node of their NUMA machines thought set CPU affinity. I also write IA64 part support which I would send to XEN-IA64 mail-list. Thanks. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Daniel P. Berrange
2008-Feb-26 02:39 UTC
Re: [Xen-devel] [PATCH]Add free memory size of every NUMA node in phsical info
On Tue, Feb 26, 2008 at 10:02:36AM +0800, Duan, Ronghui wrote:> Returns free memory size per node in "xm info". This info can help users > who want to bind their guest domain in one node of their NUMA machines > thought set CPU affinity. I also write IA64 part support which I would > send to XEN-IA64 mail-list. Thanks.AFAICT, changing the ABI of the ''physinfo'' sysctl is completely unneccessary. The per-node NUMA free memory information is already available to Dom0 via the existing ''availheap'' sysctl: #define XEN_SYSCTL_availheap 9 struct xen_sysctl_availheap { /* IN variables. */ uint32_t min_bitwidth; /* Smallest address width (zero if don''t care). */ uint32_t max_bitwidth; /* Largest address width (zero if don''t care). */ int32_t node; /* NUMA node of interest (-1 for all nodes). */ /* OUT variables. */ uint64_aligned_t avail_bytes;/* Bytes available in the specified region. */ }; If you want to display this info in ''xm info'', then simply invoke this availheap sysctl call to fetch the data. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Duan, Ronghui
2008-Feb-26 02:46 UTC
RE: [Xen-devel] [PATCH]Add free memory size of every NUMA node in phsical info
I see that, the reason I don''t use that function is there need one more time hypercall, I only reuse the function which have been realized in hypervisor. Thanks for your advice.>-----Original Message----- >From: Daniel P. Berrange [mailto:berrange@redhat.com] >Sent: Tuesday, February 26, 2008 10:40 AM >To: Duan, Ronghui >Cc: xen-devel@lists.xensource.com >Subject: Re: [Xen-devel] [PATCH]Add free memory size of every NUMA nodein>phsical info > >On Tue, Feb 26, 2008 at 10:02:36AM +0800, Duan, Ronghui wrote: >> Returns free memory size per node in "xm info". This info can helpusers>> who want to bind their guest domain in one node of their NUMAmachines>> thought set CPU affinity. I also write IA64 part support which Iwould>> send to XEN-IA64 mail-list. Thanks. > >AFAICT, changing the ABI of the ''physinfo'' sysctl is completely >unneccessary. > >The per-node NUMA free memory information is already available to Dom0 >via the existing ''availheap'' sysctl: > > #define XEN_SYSCTL_availheap 9 > struct xen_sysctl_availheap { > /* IN variables. */ > uint32_t min_bitwidth; /* Smallest address width (zero if don''t >care). */ > uint32_t max_bitwidth; /* Largest address width (zero if don''tcare).>*/ > int32_t node; /* NUMA node of interest (-1 for allnodes).>*/ > /* OUT variables. */ > uint64_aligned_t avail_bytes;/* Bytes available in the specified >region. */ > }; > > >If you want to display this info in ''xm info'', then simply invoke this >availheap sysctl call to fetch the data. > >Dan. >-- >|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 3922496 ->=| >|=- Perl modules: http://search.cpan.org/~danberr/->=| >|=- Projects: http://freshmeat.net/~danielpb/->=| >|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B9505 ->=|_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Daniel P. Berrange
2008-Feb-26 03:02 UTC
Re: [Xen-devel] [PATCH]Add free memory size of every NUMA node in phsical info
On Tue, Feb 26, 2008 at 10:46:17AM +0800, Duan, Ronghui wrote:> I see that, the reason I don''t use that function is there need one more > time hypercall, I only reuse the function which have been realized in > hypervisor. Thanks for your advice.The performance impact of doing 1 extra hypercall for ''availheap'' is completely irrelevant in this context. The time for 1 extra hypercall is dwarfed (by several orders of magnitude) by the overhead due to ''xm'' and ''xend'' being in python & using XML-RPC. We should just use the existing hypercall & not worry about time overhead we''ll never notice. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Duan, Ronghui
2008-Feb-26 03:39 UTC
RE: [Xen-devel] [PATCH]Add free memory size of every NUMA node in phsical info
Thanks for your advice. As far as I know, xc_availheap will return specific node''s free memory, in this context we need all nodes'' info, so under the most conditions if use xc_availheap, there may be 4~8 times hypercall, one time per node. So in my methods, I allocate more memory to let one hpercall to return a list instead of a value. It is something related with time complexity and space complexity. This info has the same attribute with "cpu_to_node" in physical info. So I think it is better to get them using the same methods. Thanks again.>-----Original Message----- >From: Daniel P. Berrange [mailto:berrange@redhat.com] >Sent: Tuesday, February 26, 2008 11:02 AM >To: Duan, Ronghui >Cc: xen-devel@lists.xensource.com >Subject: Re: [Xen-devel] [PATCH]Add free memory size of every NUMA nodein>phsical info > >On Tue, Feb 26, 2008 at 10:46:17AM +0800, Duan, Ronghui wrote: >> I see that, the reason I don''t use that function is there need onemore>> time hypercall, I only reuse the function which have been realized in >> hypervisor. Thanks for your advice. > >The performance impact of doing 1 extra hypercall for ''availheap'' is >completely irrelevant in this context. The time for 1 extra hypercall >is dwarfed (by several orders of magnitude) by the overhead due to >''xm'' and ''xend'' being in python & using XML-RPC. We should just use >the existing hypercall & not worry about time overhead we''ll never >notice. > >Dan. >-- >|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 3922496 ->=| >|=- Perl modules: http://search.cpan.org/~danberr/->=| >|=- Projects: http://freshmeat.net/~danielpb/->=| >|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B9505 ->=|_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Duan, Ronghui
2008-Feb-26 07:58 UTC
RE: [Xen-devel] [PATCH]Add free memory size of every NUMA node inphsical info
Thank for Dan''s advice, rewrite it using current interface. ________________________________ From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Duan, Ronghui Sent: Tuesday, February 26, 2008 10:03 AM To: xen-devel@lists.xensource.com Subject: [Xen-devel] [PATCH]Add free memory size of every NUMA node inphsical info Returns free memory size per node in "xm info". This info can help users who want to bind their guest domain in one node of their NUMA machines thought set CPU affinity. I also write IA64 part support which I would send to XEN-IA64 mail-list. Thanks. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2008-Feb-26 08:43 UTC
Re: [Xen-devel] [PATCH]Add free memory size of every NUMA node inphsical info
Looks better, thanks. I¹ll check this one in. -- Keir On 26/2/08 07:58, "Duan, Ronghui" <ronghui.duan@intel.com> wrote:> Thank for Dan¹s advice, rewrite it using current interface. > > > > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Duan, Ronghui > Sent: Tuesday, February 26, 2008 10:03 AM > To: xen-devel@lists.xensource.com > Subject: [Xen-devel] [PATCH]Add free memory size of every NUMA node inphsical > info > > Returns free memory size per node in ³xm info². This info can help users who > want to bind their guest domain in one node of their NUMA machines thought set > CPU affinity. I also write IA64 part support which I would send to XEN-IA64 > mail-list. Thanks. > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Daniel P. Berrange
2008-Feb-26 12:50 UTC
Re: [Xen-devel] [PATCH]Add free memory size of every NUMA node inphsical info
On Tue, Feb 26, 2008 at 03:58:20PM +0800, Duan, Ronghui wrote:> Thank for Dan''s advice, rewrite it using current interface.Thanks for changing that - it looks much nicer now & avoids ABI break :-) Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel