Skip to contentSkip to conversation

xl/vNUMA: Allow empty memory nodes

PATCH In review Boris Ostrovsky 3 participants 5 messages Aug 14, 2015 – Aug 16, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xl/vNUMA: Allow empty memory nodes

The test for 'nr_vmemranges < nr_vnodes' in xc_domain_setvnuma() was originally writtten with the idea that number of memory ranges would at least be equal to number of nodes.

We may want to specify nodes with no memory, however, and thus this check should be removed.

---
 tools/libxc/xc_domain.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/libxc/xc_domain.c +1 -2
index 2ee26fb..780797f 100644
@@ -2451,8 +2451,7 @@ int xc_domain_setvnuma(xc_interface *xch,
                              XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
     errno = EINVAL;
 
-    if ( nr_vnodes == 0 || nr_vmemranges == 0 ||
-         nr_vmemranges < nr_vnodes || nr_vcpus == 0 )
+    if ( nr_vnodes == 0 || nr_vmemranges == 0 || nr_vcpus == 0 )
         return -1;
 
     if ( !vdistance || !vcpu_to_vnode || !vmemrange || !vnode_to_pnode )
Signature · 1 line
1.9.3
Acked-by on v1 1/1
#1 lore raw

This title should say "libxc: ..."

Quoted 8 lines · Boris Ostrovsky

The test for 'nr_vmemranges < nr_vnodes' in xc_domain_setvnuma() was originally writtten with the idea that number of memory ranges would at least be equal to number of nodes.

We may want to specify nodes with no memory, however, and thus this check should be removed.

With my RM hat on, because libxl, hypervisor and hvmloader can already cope with 0 vmemrange configuration, removing this restriction is safe.

Quoted 20 lines
---
 tools/libxc/xc_domain.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/libxc/xc_domain.c +1 -2
index 2ee26fb..780797f 100644
@@ -2451,8 +2451,7 @@ int xc_domain_setvnuma(xc_interface *xch,
                              XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
     errno = EINVAL;
 
-    if ( nr_vnodes == 0 || nr_vmemranges == 0 ||
-         nr_vmemranges < nr_vnodes || nr_vcpus == 0 )
+    if ( nr_vnodes == 0 || nr_vmemranges == 0 || nr_vcpus == 0 )
         return -1;
 
     if ( !vdistance || !vcpu_to_vnode || !vmemrange || !vnode_to_pnode )
Signature · 1 line
1.9.3
#2 lore raw
Quoted 1 line · Wei Liu

This title should say "libxc: ..."

Ah, of course. Let me know if you want me to re-send it.

-boris

Quoted 37 lines · Boris Ostrovsky
Quoted 8 lines

The test for 'nr_vmemranges < nr_vnodes' in xc_domain_setvnuma() was originally writtten with the idea that number of memory ranges would at least be equal to number of nodes.

We may want to specify nodes with no memory, however, and thus this check should be removed.

With my RM hat on, because libxl, hypervisor and hvmloader can already cope with 0 vmemrange configuration, removing this restriction is safe.

Quoted 20 lines
---
  tools/libxc/xc_domain.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
tools/libxc/xc_domain.c +1 -2
index 2ee26fb..780797f 100644
@@ -2451,8 +2451,7 @@ int xc_domain_setvnuma(xc_interface *xch,
                               XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
      errno = EINVAL;
 
-    if ( nr_vnodes == 0 || nr_vmemranges == 0 ||
-         nr_vmemranges < nr_vnodes || nr_vcpus == 0 )
+    if ( nr_vnodes == 0 || nr_vmemranges == 0 || nr_vcpus == 0 )
          return -1;
 
      if ( !vdistance || !vcpu_to_vnode || !vmemrange || !vnode_to_pnode )
Signature · 1 line
1.9.3
#3 lore raw
Quoted 5 lines · Boris Ostrovsky
Quoted 1 line · Wei Liu

This title should say "libxc: ..."

Ah, of course. Let me know if you want me to re-send it.

No need. I will ask Ian to handle this while committing.

Wei.

Quoted 37 lines

-boris

Quoted 35 lines · Boris Ostrovsky
Quoted 8 lines

The test for 'nr_vmemranges < nr_vnodes' in xc_domain_setvnuma() was originally writtten with the idea that number of memory ranges would at least be equal to number of nodes.

We may want to specify nodes with no memory, however, and thus this check should be removed.

With my RM hat on, because libxl, hypervisor and hvmloader can already cope with 0 vmemrange configuration, removing this restriction is safe.

Quoted 18 lines
---
 tools/libxc/xc_domain.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/libxc/xc_domain.c +1 -2
index 2ee26fb..780797f 100644
@@ -2451,8 +2451,7 @@ int xc_domain_setvnuma(xc_interface *xch,
                              XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
     errno = EINVAL;
-    if ( nr_vnodes == 0 || nr_vmemranges == 0 ||
-         nr_vmemranges < nr_vnodes || nr_vcpus == 0 )
+    if ( nr_vnodes == 0 || nr_vmemranges == 0 || nr_vcpus == 0 )
         return -1;
     if ( !vdistance || !vcpu_to_vnode || !vmemrange || !vnode_to_pnode )
Signature · 1 line
1.9.3
#4 lore raw
Quoted 8 lines · Wei Liu
Quoted 5 lines · Boris Ostrovsky
Quoted 1 line · Wei Liu

This title should say "libxc: ..."

Ah, of course. Let me know if you want me to re-send it.

No need. I will ask Ian to handle this while committing.

Done.