forked from pool/numactl
Compare commits
11 Commits
Author | SHA256 | Date | |
---|---|---|---|
38642280f0 | |||
dbfa70269c | |||
7a29fdf7ac | |||
a2edd28428 | |||
6da5be7bde | |||
85a793aa44 | |||
fa3c02aa35 | |||
accc9e60cc | |||
f2f134b9bd | |||
203e244194 | |||
84daa03e2f |
@@ -1,40 +0,0 @@
|
||||
From 5dce07818a2f2c6ebde399f58702fe5beecb2eed Mon Sep 17 00:00:00 2001
|
||||
From: Julian Wolf <juwolf@suse.com>
|
||||
Date: Fri, 18 Jul 2014 14:05:05 +0200
|
||||
Subject: [PATCH] Fixed segfault when no node could be found in sysfs
|
||||
bnc#872922
|
||||
|
||||
---
|
||||
distance.c | 15 ++++++---------
|
||||
1 file changed, 6 insertions(+), 9 deletions(-)
|
||||
|
||||
Index: numactl-2.0.10/distance.c
|
||||
===================================================================
|
||||
--- numactl-2.0.10.orig/distance.c 2014-10-03 22:49:11.000000000 +0200
|
||||
+++ numactl-2.0.10/distance.c 2015-01-20 19:07:43.397202100 +0100
|
||||
@@ -58,19 +58,16 @@
|
||||
int *table = NULL;
|
||||
int err = -1;
|
||||
|
||||
- for (nd = 0;; nd++) {
|
||||
+ for (nd = 0; nd < maxnode; nd++) {
|
||||
char fn[100];
|
||||
FILE *dfh;
|
||||
sprintf(fn, "/sys/devices/system/node/node%d/distance", nd);
|
||||
dfh = fopen(fn, "r");
|
||||
- if (!dfh) {
|
||||
- if (errno == ENOENT)
|
||||
- err = 0;
|
||||
- if (!err && nd<maxnode)
|
||||
- continue;
|
||||
- else
|
||||
- break;
|
||||
- }
|
||||
+ if (dfh)
|
||||
+ err = 0;
|
||||
+ else
|
||||
+ continue;
|
||||
+
|
||||
len = getdelim(&line, &linelen, '\n', dfh);
|
||||
fclose(dfh);
|
||||
if (len <= 0)
|
38
Cleanup-No-need-to-suppress-possible-errno-anymore.patch
Normal file
38
Cleanup-No-need-to-suppress-possible-errno-anymore.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From: Thomas Renninger <trenn@suse.de>
|
||||
Subject: Cleanup: No need to suppress possible errno anymore
|
||||
References:
|
||||
Patch-Mainline:
|
||||
Git-commit: cb6f53ead8c1af3b0d984015638acbc46139e5ba
|
||||
|
||||
|
||||
Since has_preferred_many is only called in numa_init
|
||||
again (renamed to set_kernel_abi) there is no need
|
||||
to suppress errno values. errno is set to zero at
|
||||
end of numa_init anyway.
|
||||
|
||||
Signed-off-by: Thomas Renninger <trenn@suse.com>
|
||||
|
||||
|
||||
Signed-off-by: <trenn@suse.de>
|
||||
diff --git a/libnuma.c b/libnuma.c
|
||||
index 29349ee..2b515d0 100644
|
||||
--- a/libnuma.c
|
||||
+++ b/libnuma.c
|
||||
@@ -627,9 +627,6 @@ set_kernel_abi(void)
|
||||
{
|
||||
int oldp;
|
||||
struct bitmask *bmp, *tmp;
|
||||
- int old_errno;
|
||||
-
|
||||
- old_errno = errno;
|
||||
|
||||
bmp = numa_allocate_nodemask();
|
||||
tmp = numa_get_mems_allowed();
|
||||
@@ -648,7 +645,6 @@ set_kernel_abi(void)
|
||||
out:
|
||||
numa_bitmask_free(tmp);
|
||||
numa_bitmask_free(bmp);
|
||||
- errno = old_errno;
|
||||
}
|
||||
|
||||
/*
|
89
Cleanup-move-has_preferred_many-to-numa_init-again.patch
Normal file
89
Cleanup-move-has_preferred_many-to-numa_init-again.patch
Normal file
@@ -0,0 +1,89 @@
|
||||
From: Thomas Renninger <trenn@suse.de>
|
||||
Subject: Cleanup: move has_preferred_many to numa_init again
|
||||
References:
|
||||
Patch-Mainline:
|
||||
Git-commit: 391e4e254fc50f625114ceb8c1fecb178e395c47
|
||||
|
||||
|
||||
Reverts: fd4ec69686ec
|
||||
|
||||
Above commit delays the check whether the system supports
|
||||
has_preferred_many.
|
||||
This makes initialization unnecessary complex and error prone.
|
||||
|
||||
The real fix of fd4ec69686ec (use {get,set}_mempolicy instead
|
||||
of {get,set}pol)
|
||||
is still included:
|
||||
- setpol(oldp, bmp);
|
||||
+ (void)set_mempolicy(oldp, bmp->maskp, bmp->size+1);
|
||||
|
||||
Signed-off-by: Thomas Renninger <trenn@suse.com>
|
||||
|
||||
|
||||
Signed-off-by: <trenn@suse.de>
|
||||
diff --git a/libnuma.c b/libnuma.c
|
||||
index 380e8a6..29349ee 100644
|
||||
--- a/libnuma.c
|
||||
+++ b/libnuma.c
|
||||
@@ -80,7 +80,7 @@ static int numproccpu = -1;
|
||||
static int nodemask_sz = 0;
|
||||
static int cpumask_sz = 0;
|
||||
|
||||
-static int has_preferred_many = -1;
|
||||
+static int has_preferred_many = 0;
|
||||
|
||||
int numa_exit_on_error = 0;
|
||||
int numa_exit_on_warn = 0;
|
||||
@@ -623,19 +623,14 @@ set_configured_cpus(void)
|
||||
}
|
||||
|
||||
static void
|
||||
-set_preferred_many(void)
|
||||
+set_kernel_abi(void)
|
||||
{
|
||||
int oldp;
|
||||
struct bitmask *bmp, *tmp;
|
||||
int old_errno;
|
||||
|
||||
- if (has_preferred_many >= 0)
|
||||
- return;
|
||||
-
|
||||
old_errno = errno;
|
||||
|
||||
- has_preferred_many = 0;
|
||||
-
|
||||
bmp = numa_allocate_nodemask();
|
||||
tmp = numa_get_mems_allowed();
|
||||
if (!tmp || !bmp)
|
||||
@@ -668,6 +663,7 @@ set_sizes(void)
|
||||
set_numa_max_cpu(); /* size of kernel cpumask_t */
|
||||
set_configured_cpus(); /* cpus listed in /sys/devices/system/cpu */
|
||||
set_task_constraints(); /* cpus and nodes for current task */
|
||||
+ set_kernel_abi(); /* man policy supported */
|
||||
}
|
||||
|
||||
int
|
||||
@@ -1164,7 +1160,6 @@ void *numa_alloc_local(size_t size)
|
||||
|
||||
void numa_set_bind_policy(int strict)
|
||||
{
|
||||
- set_preferred_many();
|
||||
if (strict)
|
||||
bind_policy = MPOL_BIND;
|
||||
else if (has_preferred_many)
|
||||
@@ -1992,7 +1987,6 @@ void numa_set_preferred(int node)
|
||||
|
||||
int numa_has_preferred_many(void)
|
||||
{
|
||||
- set_preferred_many();
|
||||
return has_preferred_many;
|
||||
}
|
||||
|
||||
@@ -2000,7 +1994,6 @@ void numa_set_preferred_many(struct bitmask *bitmask)
|
||||
{
|
||||
int first_node = 0;
|
||||
|
||||
- set_preferred_many();
|
||||
if (!has_preferred_many) {
|
||||
numa_warn(W_nodeparse,
|
||||
"Unable to handle MANY preferred nodes. Falling back to first node\n");
|
7
_service
7
_service
@@ -1,13 +1,12 @@
|
||||
<services>
|
||||
<service name="obs_scm" mode="localonly">
|
||||
<service name="obs_scm" mode="manual">
|
||||
<param name="scm">git</param>
|
||||
<param name="url">https://github.com/numactl/numactl</param>
|
||||
<param name="revision">HEAD</param>
|
||||
<param name="url">http://github.com/numactl/numactl</param>
|
||||
<param name="versionrewrite-pattern">v(.*)</param>
|
||||
<param name="versionformat">@PARENT_TAG@.@TAG_OFFSET@.g%h</param>
|
||||
<param name="changesgenerate">enable</param>
|
||||
</service>
|
||||
<service name="set_version" mode="localonly"/>
|
||||
<service name="set_version" mode="manual"/>
|
||||
<service name="tar" mode="buildtime"/>
|
||||
<service name="recompress" mode="buildtime">
|
||||
<param name="file">*.tar</param>
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<servicedata>
|
||||
<service name="tar_scm">
|
||||
<param name="url">https://github.com/numactl/numactl</param>
|
||||
<param name="changesrevision">3871b1c42fc71bceadafd745d2eff5dddfc2d67e</param></service></servicedata>
|
||||
<param name="changesrevision">4bfdcc6e6111c5bf5d4ccb46f227aea80cc57159</param></service><service name="tar_scm">
|
||||
<param name="url">http://github.com/numactl/numactl</param>
|
||||
<param name="changesrevision">690a72cabb010d02c910f54782641737bf947e77</param></service></servicedata>
|
BIN
numactl-2.0.18.0.g3871b1c.obscpio
(Stored with Git LFS)
BIN
numactl-2.0.18.0.g3871b1c.obscpio
(Stored with Git LFS)
Binary file not shown.
BIN
numactl-2.0.19.14.g690a72c.obscpio
(Stored with Git LFS)
Normal file
BIN
numactl-2.0.19.14.g690a72c.obscpio
(Stored with Git LFS)
Normal file
Binary file not shown.
@@ -1,28 +0,0 @@
|
||||
--- numactl-2.0.10.orig/clearcache.c
|
||||
+++ numactl-2.0.10/clearcache.c
|
||||
@@ -54,24 +54,5 @@ void fallback_clearcache(void)
|
||||
|
||||
void clearcache(unsigned char *mem, unsigned size)
|
||||
{
|
||||
-#if defined(__i386__) || defined(__x86_64__)
|
||||
- unsigned i, cl, eax, feat;
|
||||
- /* get clflush unit and feature */
|
||||
- asm("cpuid" : "=a" (eax), "=b" (cl), "=d" (feat) : "0" (1) : "cx");
|
||||
- if (!(feat & (1 << 19)))
|
||||
- fallback_clearcache();
|
||||
- cl = ((cl >> 8) & 0xff) * 8;
|
||||
- for (i = 0; i < size; i += cl)
|
||||
- asm("clflush %0" :: "m" (mem[i]));
|
||||
-#elif defined(__ia64__)
|
||||
- unsigned long cl, endcl;
|
||||
- // flush probable 128 byte cache lines (but possibly 64 bytes)
|
||||
- cl = (unsigned long)mem;
|
||||
- endcl = (unsigned long)(mem + (size-1));
|
||||
- for (; cl <= endcl; cl += 64)
|
||||
- asm ("fc %0" :: "r"(cl) : "memory" );
|
||||
-#else
|
||||
-#warning "Consider adding a clearcache implementation for your architecture"
|
||||
- fallback_clearcache();
|
||||
-#endif
|
||||
+ __builtin___clear_cache(mem, (mem + (size-1)));
|
||||
}
|
@@ -1,3 +1,72 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 4 13:34:03 UTC 2025 - Thomas Renninger <trenn@suse.de>
|
||||
|
||||
- bsc#1247093 bsc#1246858
|
||||
Cleanup code by reverting 2 patches and get back to old
|
||||
has_preferred_many initialization.
|
||||
This allows to call numa_set_bind_policy early again.
|
||||
A Cleanup-No-need-to-suppress-possible-errno-anymore.patch
|
||||
A Cleanup-move-has_preferred_many-to-numa_init-again.patch
|
||||
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 30 18:02:29 UTC 2025 - Thomas Renninger <trenn@suse.de>
|
||||
|
||||
- Update to version 2.0.19.14.g690a72c:
|
||||
* numastat command fails on LPAR which is not having node0
|
||||
|
||||
Patch is now upstream:
|
||||
https://github.com/numactl/numactl/pull/246
|
||||
D 4abeee1aac20a7a2552870e0359b8df013ae9037.patch
|
||||
|
||||
Patches are wrong or not needed anymore:
|
||||
https://github.com/numactl/numactl/pull/246
|
||||
D 0001-Fixed-segfault-when-no-node-could-be-found-in-sysfs-.patch
|
||||
D numactl-clearcache-pie.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jun 24 11:19:25 UTC 2025 - Thomas Renninger <trenn@suse.de>
|
||||
|
||||
- Fix Node0 does not exist (bsc#1244492)
|
||||
A 4abeee1aac20a7a2552870e0359b8df013ae9037.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 11 12:36:18 UTC 2025 - trenn@suse.de
|
||||
|
||||
- Update to version 2.0.19.13.g63e0223:
|
||||
* libnuma.c: Introduce numa_preferred_err()
|
||||
* numactl: Add --show option support for MPOL_WEIGHTED_INTERLEAVE
|
||||
* Add numa_get_weighted_interleave_mask() API
|
||||
* libnuma: Add APIs for weighted-interleaved allocations
|
||||
* libnuma.c: Fix memleak in numa_has_home_node()
|
||||
* Replace fgrep with grep -F to fix warning
|
||||
* Make numa_available respect EPERM
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 10 08:37:28 UTC 2024 - trenn@suse.de
|
||||
|
||||
- Update to version 2.0.18.10.g6c14bd5:
|
||||
* Save and restore errno when probing for SET_PREFERRED_MANY
|
||||
* libnuma: fix nodemask allocation size for get_mempolicy
|
||||
* Update numactl.c
|
||||
* numastat: eliminate hard-coded tables
|
||||
* Don't fail build when set_mempolicy_home_node syscall is unknown
|
||||
* numactl: Add documentation for weighted interleave
|
||||
* numactl: Fix RESOURCE_LEAK in show()
|
||||
* numademo: Fix the using of the uninitialized value
|
||||
* Add `-w` and `--weighted-interleave` for weighted interleave mode
|
||||
* Fix fallback for set_mempolicy_home_node syscall
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 13 12:59:04 UTC 2024 - trenn@suse.de
|
||||
|
||||
- Update to version 2.0.18.5.g4bfdcc6:
|
||||
* numactl: Add documentation for weighted interleave
|
||||
* numactl: Fix RESOURCE_LEAK in show()
|
||||
* numademo: Fix the using of the uninitialized value
|
||||
* Add `-w` and `--weighted-interleave` for weighted interleave mode
|
||||
* Fix fallback for set_mempolicy_home_node syscall
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 22 14:07:43 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
name: numactl
|
||||
version: 2.0.18.0.g3871b1c
|
||||
mtime: 1707290436
|
||||
commit: 3871b1c42fc71bceadafd745d2eff5dddfc2d67e
|
||||
version: 2.0.19.14.g690a72c
|
||||
mtime: 1750883782
|
||||
commit: 690a72cabb010d02c910f54782641737bf947e77
|
||||
|
11
numactl.spec
11
numactl.spec
@@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
Name: numactl
|
||||
Version: 2.0.18.0.g3871b1c
|
||||
Version: 2.0.19.14.g690a72c
|
||||
Release: 0
|
||||
Summary: NUMA Policy Control
|
||||
License: GPL-2.0-only
|
||||
@@ -25,9 +25,12 @@ Group: System/Management
|
||||
URL: https://github.com/numactl/numactl/releases
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
Source2: baselibs.conf
|
||||
# PATCH-FIX-OPENSUSE -- Avoid segfault when no node can be found in sysfs
|
||||
Patch1: 0001-Fixed-segfault-when-no-node-could-be-found-in-sysfs-.patch
|
||||
Patch2: numactl-clearcache-pie.patch
|
||||
#PATCH-FEATURE-UPSTREAM
|
||||
#https://github.com/numactl/numactl/pull/249
|
||||
Patch0: Cleanup-move-has_preferred_many-to-numa_init-again.patch
|
||||
#PATCH-FEATURE-UPSTREAM
|
||||
#https://github.com/numactl/numactl/pull/249
|
||||
Patch1: Cleanup-No-need-to-suppress-possible-errno-anymore.patch
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: libtool
|
||||
|
Reference in New Issue
Block a user