Re: [libvirt] [PATCH v5 1/4] numa: describe siblings distances within cells

2017-10-25 Thread Jim Fehlig

On 10/12/2017 01:31 PM, Wim Ten Have wrote:

From: Wim ten Have 

Add support for describing NUMA distances in a domain's  
XML description.

Below is an example of a 4 node setup:

   
 
   
 
   
   
   
   
 
   
   
 
   
   
   
   
 
   
   
 
   
   
   
   
 
   
 
   
   
   
   
 
   
 
   

A  defines a NUMA node.  describes the NUMA distance
from the  to the other NUMA nodes (the s).  For example,
in above XML description, the distance between NUMA node0  and NUMA node2  is 31.

Valid distance value are '10 <= value <= 255'.  A distance value of 10
represents the distance to the node itself.  A distance value of 20
represents the default value for remote nodes but other values are
possible depending on the physical topology of the system.

When distances are not fully described, any missing sibling distance
values will default to 10 for local nodes and 20 for remote nodes.

Signed-off-by: Wim ten Have 
---
Changes on v1:
- Add changes to docs/formatdomain.html.in describing schema update.
Changes on v2:
- Automatically apply distance symmetry maintaining cell <-> sibling.
- Check for maximum '255' on numaDistanceValue.
- Automatically complete empty distance ranges.
- Check that sibling_id's are in range with cell identifiers.
- Allow non-contiguous ranges, starting from any node id.
- Respect parameters as ATTRIBUTE_NONNULL fix functions and callers.
- Add and apply topology for LOCAL_DISTANCE=10 and REMOTE_DISTANCE=20.
Changes on v3
- Add UNREACHABLE if one locality is unreachable from another.
- Add code cleanup aligning function naming in a separated patch.
- Add numa related driver code in a separated patch.
- Remove  from numaDistanceValue schema/basictypes.rng
- Correct doc changes.
Changes on v4
- Fix symmetry error under virDomainNumaDefNodeDistanceParseXML()
---
  docs/formatdomain.html.in   |  63 -
  docs/schemas/basictypes.rng |   7 ++
  docs/schemas/cputypes.rng   |  18 
  src/conf/numa_conf.c| 221 +++-
  4 files changed, 305 insertions(+), 4 deletions(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index c0e3c2221..ab2a89c6a 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1529,7 +1529,68 @@
  
  
  

-  This guest NUMA specification is currently available only for QEMU/KVM.
+  This guest NUMA specification is currently available only for
+  QEMU/KVM and Xen.  Whereas Xen driver also allows for a distinct
+  description of NUMA arranged sibling cell
+  distances Since 3.8.0.


Now 3.9.0.


+
+
+
+  Under NUMA h/w architecture, distinct resources such as memory


For the website docs, I think it is better to write "hardware" instead of "h/w".


+  create a designated distance between cell and
+  siblings that now can be described with the help of
+  distances. A detailed description can be found within
+  the ACPI (Advanced Configuration and Power Interface Specification)
+  within the chapter explaining the system's SLIT (System Locality
+  Distance Information Table).
+
+
+
+...
+cpu
+  ...
+  numa
+cell id='0' cpus='0,4-7' memory='512000' unit='KiB'
+  distances
+sibling id='0' value='10'/
+sibling id='1' value='21'/
+sibling id='2' value='31'/
+sibling id='3' value='41'/
+  /distances
+/cell
+cell id='1' cpus='1,8-10,12-15' memory='512000' unit='KiB' 
memAccess='shared'
+  distances
+sibling id='0' value='21'/
+sibling id='1' value='10'/
+sibling id='2' value='21'/
+sibling id='3' value='31'/
+  /distances
+/cell
+cell id='2' cpus='2,11' memory='512000' unit='KiB' 
memAccess='shared'
+  distances
+sibling id='0' value='31'/
+sibling id='1' value='21'/
+sibling id='2' value='10'/
+sibling id='3' value='21'/
+  /distances
+/cell
+cell id='3' cpus='3' memory='512000' unit='KiB'
+  distances
+sibling id='0' value='41'/
+sibling id='1' value='31'/
+sibling id='2' value='21'/
+sibling id='3' value='10'/
+  /distances
+/cell
+  /numa
+  ...
+/cpu
+...
+
+
+  Under Xen driver, if no distances are given to describe
+  the SLIT data between different cells, it will default to a scheme
+  using 10 for local and 20 for remote distances.
  
  
  Events configuration

diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
index 1ea667cdf..1a18cd31b 100644
--- a/docs/schemas/basictypes.rng
+++ b/docs/schemas/basictypes.rng
@@ -77,6 +77,13 @@
  

  
+  

+
+  10
+  255
+
+  
+

  
  

Re: [libvirt] [PATCH v5 1/4] numa: describe siblings distances within cells

2017-10-13 Thread Daniel P. Berrange
On Thu, Oct 12, 2017 at 09:31:54PM +0200, Wim Ten Have wrote:
> From: Wim ten Have 
> 
> Add support for describing NUMA distances in a domain's  
> XML description.
> 
> Below is an example of a 4 node setup:
> 
>   
> 
>   
> 
>   
>   
>   
>   
> 
>   
>   
> 
>   
>   
>   
>   
> 
>   
>   
> 
>   
>   
>   
>   
> 
>   
> 
>   
>   
>   
>   
> 
>   
> 
>   
> 
> A  defines a NUMA node.  describes the NUMA distance
> from the  to the other NUMA nodes (the s).  For example,
> in above XML description, the distance between NUMA node0  ...> and NUMA node2  is 31.
> 
> Valid distance value are '10 <= value <= 255'.  A distance value of 10
> represents the distance to the node itself.  A distance value of 20
> represents the default value for remote nodes but other values are
> possible depending on the physical topology of the system.
> 
> When distances are not fully described, any missing sibling distance
> values will default to 10 for local nodes and 20 for remote nodes.

Nitpick, IIUC, if distance is given for A -> B, then we default
B -> A to the same value instead of 20.

> Signed-off-by: Wim ten Have 

None the less for the code/design:

Reviewed-by: Daniel P. Berrange 


Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH v5 1/4] numa: describe siblings distances within cells

2017-10-12 Thread Wim Ten Have
From: Wim ten Have 

Add support for describing NUMA distances in a domain's  
XML description.

Below is an example of a 4 node setup:

  

  

  
  
  
  

  
  

  
  
  
  

  
  

  
  
  
  

  

  
  
  
  

  

  

A  defines a NUMA node.  describes the NUMA distance
from the  to the other NUMA nodes (the s).  For example,
in above XML description, the distance between NUMA node0  and NUMA node2  is 31.

Valid distance value are '10 <= value <= 255'.  A distance value of 10
represents the distance to the node itself.  A distance value of 20
represents the default value for remote nodes but other values are
possible depending on the physical topology of the system.

When distances are not fully described, any missing sibling distance
values will default to 10 for local nodes and 20 for remote nodes.

Signed-off-by: Wim ten Have 
---
Changes on v1:
- Add changes to docs/formatdomain.html.in describing schema update.
Changes on v2:
- Automatically apply distance symmetry maintaining cell <-> sibling.
- Check for maximum '255' on numaDistanceValue.
- Automatically complete empty distance ranges.
- Check that sibling_id's are in range with cell identifiers.
- Allow non-contiguous ranges, starting from any node id.
- Respect parameters as ATTRIBUTE_NONNULL fix functions and callers.
- Add and apply topology for LOCAL_DISTANCE=10 and REMOTE_DISTANCE=20.
Changes on v3
- Add UNREACHABLE if one locality is unreachable from another.
- Add code cleanup aligning function naming in a separated patch.
- Add numa related driver code in a separated patch.
- Remove  from numaDistanceValue schema/basictypes.rng
- Correct doc changes.
Changes on v4
- Fix symmetry error under virDomainNumaDefNodeDistanceParseXML()
---
 docs/formatdomain.html.in   |  63 -
 docs/schemas/basictypes.rng |   7 ++
 docs/schemas/cputypes.rng   |  18 
 src/conf/numa_conf.c| 221 +++-
 4 files changed, 305 insertions(+), 4 deletions(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index c0e3c2221..ab2a89c6a 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1529,7 +1529,68 @@
 
 
 
-  This guest NUMA specification is currently available only for QEMU/KVM.
+  This guest NUMA specification is currently available only for
+  QEMU/KVM and Xen.  Whereas Xen driver also allows for a distinct
+  description of NUMA arranged sibling cell
+  distances Since 3.8.0.
+
+
+
+  Under NUMA h/w architecture, distinct resources such as memory
+  create a designated distance between cell and
+  siblings that now can be described with the help of
+  distances. A detailed description can be found within
+  the ACPI (Advanced Configuration and Power Interface Specification)
+  within the chapter explaining the system's SLIT (System Locality
+  Distance Information Table).
+
+
+
+...
+cpu
+  ...
+  numa
+cell id='0' cpus='0,4-7' memory='512000' unit='KiB'
+  distances
+sibling id='0' value='10'/
+sibling id='1' value='21'/
+sibling id='2' value='31'/
+sibling id='3' value='41'/
+  /distances
+/cell
+cell id='1' cpus='1,8-10,12-15' memory='512000' unit='KiB' 
memAccess='shared'
+  distances
+sibling id='0' value='21'/
+sibling id='1' value='10'/
+sibling id='2' value='21'/
+sibling id='3' value='31'/
+  /distances
+/cell
+cell id='2' cpus='2,11' memory='512000' unit='KiB' 
memAccess='shared'
+  distances
+sibling id='0' value='31'/
+sibling id='1' value='21'/
+sibling id='2' value='10'/
+sibling id='3' value='21'/
+  /distances
+/cell
+cell id='3' cpus='3' memory='512000' unit='KiB'
+  distances
+sibling id='0' value='41'/
+sibling id='1' value='31'/
+sibling id='2' value='21'/
+sibling id='3' value='10'/
+  /distances
+/cell
+  /numa
+  ...
+/cpu
+...
+
+
+  Under Xen driver, if no distances are given to describe
+  the SLIT data between different cells, it will default to a scheme
+  using 10 for local and 20 for remote distances.
 
 
 Events configuration
diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
index 1ea667cdf..1a18cd31b 100644
--- a/docs/schemas/basictypes.rng
+++ b/docs/schemas/basictypes.rng
@@ -77,6 +77,13 @@
 
   
 
+  
+
+  10
+  255
+
+  
+
   
 
   
diff --git a/docs/schemas/cputypes.rng b/docs/schemas/cputypes.rng
index 3eef16abc..c45b6dfb2 100644
--- a/docs/schemas/cputypes.rng
+++ b/docs/schemas/cputypes.rng
@@ -129,6 +129,24 @@