Compare commits

..

No commits in common. "c8" and "c9" have entirely different histories.
c8 ... c9

7 changed files with 233 additions and 68 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/numactl-2.0.16.tar.gz SOURCES/numactl-2.0.19.tar.gz

View File

@ -1 +1 @@
37ea1a333827f279e940bf0ae55d6897b331f19f SOURCES/numactl-2.0.16.tar.gz 661a2cf7ad9f3f8e31e52ecf5017e521e7b97028 SOURCES/numactl-2.0.19.tar.gz

View File

@ -1,26 +0,0 @@
From 66308a7e30a964aaad324f74c74eb5b9d75a2abd Mon Sep 17 00:00:00 2001
From: Pingfan Liu <piliu@redhat.com>
Date: Mon, 12 Jun 2023 21:15:39 +0800
Subject: [PATCH] fix typo in memhog.8
Signed-off-by: Pingfan Liu <piliu@redhat.com>
---
memhog.8 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/memhog.8 b/memhog.8
index e28e784..3846e08 100644
--- a/memhog.8
+++ b/memhog.8
@@ -52,7 +52,7 @@ thread is running on)
# Allocate a 1G region, mmap backed by memhog.mmap file, membind to node 0, repeat test 6 times
memhog -r6 1G --membind 0 -fmemhog.mmap
.TP
-# Allocate a 1G region, iterleave across nodes 0,1,2,3, repeat test 4 times
+# Allocate a 1G region, interleave across nodes 0,1,2,3, repeat test 4 times
memhog -r4 1G --interleave 0-3
.TP
# Allocate a 1G region, (implicit) default policy, repeat test 8 times
--
2.31.1

View File

@ -0,0 +1,80 @@
From 1159e00f4f8604fdbb36a8fb04a1c86ce3cdc054 Mon Sep 17 00:00:00 2001
From: Pingfan Liu <piliu@redhat.com>
Date: Thu, 23 Jan 2025 18:50:09 +0800
Subject: [PATCH 1/2] libnuma.c: Introduce numa_preferred_err()
After commit 87c6834 ( libnuma: Convert preferred node into a mask),
numa_preferred() returns -1 if no suitable node is found. Before that,
it returns 0.
The users still expect the old behavior, and use 0 as an index to
an array. In order to avoid modifying the existing code, let's introduce
another API numa_preferred_err() to report error if no suitable node is
available and keep numa_preferred() in its original form.
Signed-off-by: Pingfan Liu <piliu@redhat.com>
---
libnuma.c | 12 +++++++++++-
numa.h | 3 +++
versions.ldscript | 1 +
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/libnuma.c b/libnuma.c
index 1ffe207..380e8a6 100644
--- a/libnuma.c
+++ b/libnuma.c
@@ -1947,7 +1947,7 @@ static struct bitmask *__numa_preferred(void)
return bmp;
}
-int numa_preferred(void)
+int numa_preferred_err(void)
{
int first_node = 0;
struct bitmask *bmp;
@@ -1959,6 +1959,16 @@ int numa_preferred(void)
return first_node;
}
+int numa_preferred(void)
+{
+ int first_node = 0;
+
+ first_node = numa_preferred_err();
+ first_node = first_node >= 0 ? first_node : 0;
+
+ return first_node;
+}
+
static void __numa_set_preferred(struct bitmask *bmp)
{
int nodes = numa_bitmask_weight(bmp);
diff --git a/numa.h b/numa.h
index 51a6833..f0b550b 100644
--- a/numa.h
+++ b/numa.h
@@ -140,6 +140,9 @@ int numa_max_node(void);
int numa_max_possible_node(void);
/* Return preferred node */
int numa_preferred(void);
+/* If the preferred node is unavailable, return an error;
+ otherwise, return the preferred node */
+int numa_preferred_err(void);
/* Return node size and free memory */
long long numa_node_size64(int node, long long *freep);
diff --git a/versions.ldscript b/versions.ldscript
index ee48e70..2fd6ebc 100644
--- a/versions.ldscript
+++ b/versions.ldscript
@@ -45,6 +45,7 @@ libnuma_1.1 {
numa_parse_bitmap;
numa_police_memory;
numa_preferred;
+ numa_preferred_err;
numa_run_on_node;
numa_run_on_node_mask;
numa_sched_getaffinity;
--
2.47.0

View File

@ -0,0 +1,37 @@
From 63e02235bdbcf5aa334903be2111a82b27c8c155 Mon Sep 17 00:00:00 2001
From: Pingfan Liu <piliu@redhat.com>
Date: Fri, 24 Jan 2025 11:33:32 +0800
Subject: [PATCH 2/2] doc: Update man for numa_preferred_err()
Signed-off-by: Pingfan Liu <piliu@redhat.com>
---
numa.3 | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/numa.3 b/numa.3
index af24f66..e911953 100644
--- a/numa.3
+++ b/numa.3
@@ -64,6 +64,8 @@ numa \- NUMA policy library
.sp
.B int numa_preferred(void);
.br
+.B int numa_preferred_err(void);
+.br
.B int numa_has_preferred_many(void);
.br
.B struct bitmask *numa_preferred_many(void);
@@ -448,6 +450,10 @@ allocates memory, unless some other policy overrides this.
.\" order of the current node's zonelist to return the correct
.\" node. Need to tighten this up with the syscall results.
+.BR numa_preferred_err ()
+Similiar to numa_preferred(), but If the preferred node is unavailable,
+return an error instead of zero.
+
.BR numa_has_preferred_many ()
Returns > 0 if the system supports multiple preferred nodes.
--
2.47.0

View File

@ -0,0 +1,34 @@
From 690a72cabb010d02c910f54782641737bf947e77 Mon Sep 17 00:00:00 2001
From: Seeteena Thoufeek <s1seetee@linux.ibm.com>
Date: Wed, 18 Jun 2025 10:22:23 +0530
Subject: [PATCH] numastat command fails on LPAR which is not having node0
We see the device path hardcoded with node0.
it presumes node0 always exist, and it just counts
the number of rows of information in the file for later
uses where it does process the nodes as expected.
Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
---
numastat.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/numastat.c b/numastat.c
index 7683f07..54d201c 100644
--- a/numastat.c
+++ b/numastat.c
@@ -782,8 +782,9 @@ static void show_info_from_system_file(char *file, int tok_offset)
{
char fname[64];
char buf[SMALL_BUF_SIZE];
- // Open /sys/.../node0/<file>
- snprintf(fname, sizeof(fname), "/sys/devices/system/node/node0/%s", file);
+
+ // Use the first available node for initial row counting
+ snprintf(fname, sizeof(fname), "/sys/devices/system/node/node%d/%s", node_ix_map[0], file);
FILE *fs = fopen(fname, "r");
if (!fs) {
sprintf(buf, "cannot open %s", fname);
--
2.49.0

View File

@ -1,14 +1,14 @@
Name: numactl Name: numactl
Summary: Library for tuning for Non Uniform Memory Access machines Summary: Library for tuning for Non Uniform Memory Access machines
Version: 2.0.16 Version: 2.0.19
Release: 4%{?dist} Release: 3%{dist}
# libnuma is LGPLv2 and GPLv2 # libnuma is LGPLv2 and GPLv2
# numactl binaries are GPLv2 only # numactl binaries are GPLv2 only
License: GPLv2 License: LGPL-2.1-only and GPL-2.0-only
Group: System Environment/Base
URL: https://github.com/numactl/numactl URL: https://github.com/numactl/numactl
Source0: https://github.com/numactl/numactl/releases/download/%{version}/numactl-%{version}.tar.gz Source0: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.gz
Buildroot: %{_tmppath}/%{name}-buildroot
BuildRequires: make
BuildRequires: libtool automake autoconf BuildRequires: libtool automake autoconf
ExcludeArch: s390 %{arm} ExcludeArch: s390 %{arm}
@ -37,7 +37,10 @@ ExcludeArch: s390 %{arm}
# #
# Patches 601 onward are generic patches # Patches 601 onward are generic patches
# #
Patch601: 0001-fix-typo-in-memhog.8.patch #Patch601: 0001-fix-typo-in-memhog.8.patch
Patch601: 0001-libnuma.c-Introduce-numa_preferred_err.patch
Patch602: 0002-doc-Update-man-for-numa_preferred_err.patch
Patch603: 0003-numastat-command-fails-on-LPAR-which-is-not-having-n.patch
@ -48,8 +51,7 @@ other programs with a specific NUMA policy.
%package libs %package libs
Summary: libnuma libraries Summary: libnuma libraries
# There is a tiny bit of GPLv2 code in libnuma.c # There is a tiny bit of GPLv2 code in libnuma.c
License: LGPLv2 and GPLv2 License: LGPL-2.1-only and GPL-2.0-only
Group: System Environment/Libraries
%description libs %description libs
numactl-libs provides libnuma, a library to do allocations with numactl-libs provides libnuma, a library to do allocations with
@ -57,36 +59,32 @@ NUMA policy in applications.
%package devel %package devel
Summary: Development package for building Applications that use numa Summary: Development package for building Applications that use numa
Group: System Environment/Libraries
Requires: %{name}-libs = %{version}-%{release} Requires: %{name}-libs = %{version}-%{release}
License: LGPLv2 and GPLv2 License: LGPL-2.1-only and GPL-2.0-only
%description devel %description devel
Provides development headers for numa library calls Provides development headers for numa library calls
%prep %prep
%setup -q -n %{name}-%{version} %autosetup
# Fix the missing of standard autotools auxiliary files
#patch autoreconf -i
%patch601 -p1
%build %build
aclocal && automake
%configure --prefix=/usr --libdir=%{_libdir} %configure --prefix=/usr --libdir=%{_libdir}
make clean # Using recipe to fix rpaths, from here:
make CFLAGS="$RPM_OPT_FLAGS -I." # https://fedoraproject.org/wiki/RPath_Packaging_Draft#Removing_Rpath
sed -i -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
-e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%make_build
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%make_install
make DESTDIR=$RPM_BUILD_ROOT install %ldconfig_scriptlets
%ldconfig_scriptlets libs
%post -p /sbin/ldconfig
%post libs -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%files %files
%doc README.md %doc README.md
@ -105,39 +103,81 @@ make DESTDIR=$RPM_BUILD_ROOT install
%files devel %files devel
%{_libdir}/libnuma.so %{_libdir}/libnuma.so
%{_libdir}/pkgconfig/numa.pc
%exclude %{_libdir}/libnuma.a %exclude %{_libdir}/libnuma.a
%exclude %{_libdir}/libnuma.la %exclude %{_libdir}/libnuma.la
%{_libdir}/pkgconfig/numa.pc
%{_includedir}/numa.h %{_includedir}/numa.h
%{_includedir}/numaif.h %{_includedir}/numaif.h
%{_includedir}/numacompat1.h %{_includedir}/numacompat1.h
%{_mandir}/man3/*.3* %{_mandir}/man3/*.3*
%changelog %changelog
* Mon Nov 18 2024 Pingfan Liu <piliu@redhat.com> - 2.0.19-1
- rebase to v2.0.19
* Tue Jul 30 2024 Pingfan Liu <piliu@redhat.com> - 2.0.18-1
- rebase to v2.0.18
* Thu Sep 14 2023 Pingfan Liu <piliu@redhat.com> - 2.0.16-2 * Thu Sep 14 2023 Pingfan Liu <piliu@redhat.com> - 2.0.16-2
- fix typo in memhog.8 - fix typo in memhog.8
- Remove contained patches
* Wed May 12 2021 Pingfan Liu <piliu@redhat.com> - 2.0.12-13 * Wed Nov 23 2022 Pingfan Liu <piliu@redhat.com> - 2.0.14-9
- Dummy release to get s390x binary in errata
* Tue Jan 4 2022 Pingfan Liu <piliu@redhat.com> - 2.0.14-8
- For GA release
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.0.14-7
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Tue Jul 6 2021 Pingfan Liu <piliu@redhat.com> - 2.0.14-6
- fix covscan complain
* Mon May 24 2021 Pingfan Liu <piliu@redhat.com> - 2.0.14-5
- libnuma: make numa_police_memory() free of race - libnuma: make numa_police_memory() free of race
* Sat May 9 2020 Pingfan Liu <piliu@redhat.com> - 2.0.12-11 * Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.0.14-4
- Update manpage description of --localalloc option - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Fri Mar 13 2020 Pingfan Liu <piliu@redhat.com> - 2.0.12-10 * Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.14-3
- memhog : add man page - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Apr 1 2019 Pingfan Liu <piliu@redhat.com> - 2.0.12-3 * Wed Nov 11 2020 Florian Weimer <fweimer@redhat.com> - 2.0.14-2
- add gating test cases - Trigger rebuild to avoid DT_INIT/DT_FINI with zero values
* Mon Nov 26 2018 Pingfan Liu <piliu@redhat.com> - 2.0.12-2 * Thu Sep 17 2020 Filipe Brandenburger <filbranden@gmail.com> - 2.0.14-1
- Fix: Add ShmemHugePages and ShmemPmdMapped to system_meminfo[] - Upgrade to 2.0.14
- Re-enabled LTO, now that upstream has been fixed to support it.
* Mon Nov 5 2018 Pingfan Liu <piliu@redhat.com> - 2.0.12-1 * Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.12-6
- Rebase to 2.0.12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Aug 10 2018 Lianbo Jiang <lijiang@redhat.com> - 2.0.11-8%{dist} * Wed Jul 01 2020 Jeff Law <law@redhat.com> - 2.0.12-5
- Fix compilation error (bz1611734) - Disable LTO
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.12-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Jul 25 2018 Filipe Brandenburger <filbranden@gmail.com> - 2.0.12-1
- Rebased to version 2.0.12
* Wed Jul 25 2018 Filipe Brandenburger <filbranden@gmail.com>
- Fix check-rpaths warning about including /usr/lib64 in RPATH of the binaries.
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.11-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Sat Mar 24 2018 Richard W.M. Jones <rjones@redhat.com> - 2.0.11-9%{dist}
- Fix major/minor macros on glibc 2.27.
- Update config.{guess,sub} with versions which understand riscv64.
- Remove obsolete Buildroot tag.
* Sat Feb 24 2018 Florian Weimer <fweimer@redhat.com> - 2.0.11-8%{dist} * Sat Feb 24 2018 Florian Weimer <fweimer@redhat.com> - 2.0.11-8%{dist}
- Use LDFLAGS from redhat-rpm-config - Use LDFLAGS from redhat-rpm-config