Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Update
numactl
check_for_return_val_of_numa_node_to_cpus.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File check_for_return_val_of_numa_node_to_cpus.patch of Package numactl
From: Petr Holasek <pholasek@redhat.com> Subject: libnuma: add check for return value of numa_node_to_cpus References: bsc#955334 Patch-Mainline: v2.0.11-rc1 Git-commit: 32075635db57c3d5efe12f8fb569af857e01ccad Git-repo: github.com/filbranden/numactl.git Signed-off-by: Thomas Renninger <trenn@suse.de> When numa_node_to_cpu() has been called on machine with non-contiguous nodes, it returned the first node which wasn't present on machine. Now, return code is checked and code skips over non-existing nodes to the right one. Also, caching of numa_node_to_cpus_v2() result while non-zero error had been returned was disabled. Signed-off-by: Petr Holasek <pholasek@redhat.com> Tested by Cliff Wickman (on attica.sgi.com) diff --git a/libnuma.c b/libnuma.c index 91425ae..8d7bf13 100644 --- a/libnuma.c +++ b/libnuma.c @@ -1382,8 +1382,12 @@ numa_node_to_cpus_v2(int node, struct bitmask *buffer) if (mask != buffer) numa_bitmask_free(mask); } else { - node_cpu_mask_v2[node] = mask; - } + /* we don't want to cache faulty result */ + if (!err) + node_cpu_mask_v2[node] = mask; + else + numa_bitmask_free(mask); + } return err; } __asm__(".symver numa_node_to_cpus_v2,numa_node_to_cpus@@libnuma_1.2"); @@ -1405,7 +1409,10 @@ int numa_node_of_cpu(int cpu) bmp = numa_bitmask_alloc(ncpus); nnodes = numa_max_node(); for (node = 0; node <= nnodes; node++){ - numa_node_to_cpus_v2_int(node, bmp); + if (numa_node_to_cpus_v2_int(node, bmp) < 0) { + /* It's possible for the node to not exist */ + continue; + } if (numa_bitmask_isbitset(bmp, cpu)){ ret = node; goto end;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor