This commit is contained in:
parent
f3fc46444c
commit
16d1fc5f78
61
numactl-hardware-bits_per_long_cpus.diff
Normal file
61
numactl-hardware-bits_per_long_cpus.diff
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
From: Arnd Bergmann <arnd@arndb.de>
|
||||||
|
To: Cliff Wickman <cpw@sgi.com>
|
||||||
|
Subject: [PATCH] fix output of numactl --hardware with >BITS_PER_LONG cpus
|
||||||
|
Date: Wed, 28 Jan 2009 17:41:16 +0100
|
||||||
|
Cc: linux-numa@vger.kernel.org,
|
||||||
|
hannsj_uhl@de.ibm.com,
|
||||||
|
wmb@us.ibm.com
|
||||||
|
|
||||||
|
There was evidently a glitch in the conversion of numactl to libnuma2:
|
||||||
|
|
||||||
|
The print_node_cpus function tries to find the size of the bitmask,
|
||||||
|
which it no longer needs to. This results in printing only the
|
||||||
|
first word of the CPU mask.
|
||||||
|
|
||||||
|
This fixes the function to print all available CPUs again.
|
||||||
|
|
||||||
|
Found by Bill Buros on a 128-way 64 bit system.
|
||||||
|
|
||||||
|
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
|
||||||
|
|
||||||
|
---
|
||||||
|
numactl.c | 24 ++++++------------------
|
||||||
|
1 file changed, 6 insertions(+), 18 deletions(-)
|
||||||
|
|
||||||
|
--- a/numactl.c
|
||||||
|
+++ b/numactl.c
|
||||||
|
@@ -199,28 +199,16 @@ static void print_distances(int maxnode)
|
||||||
|
|
||||||
|
void print_node_cpus(int node)
|
||||||
|
{
|
||||||
|
- int len = 1;
|
||||||
|
int conf_cpus = numa_num_configured_cpus();
|
||||||
|
+ int i, err;
|
||||||
|
+ struct bitmask *cpus;
|
||||||
|
|
||||||
|
- for (;;) {
|
||||||
|
- int i, err;
|
||||||
|
- struct bitmask *cpus;
|
||||||
|
-
|
||||||
|
- cpus = numa_bitmask_alloc(conf_cpus);
|
||||||
|
- errno = 0;
|
||||||
|
- err = numa_node_to_cpus(node, cpus);
|
||||||
|
- if (err < 0) {
|
||||||
|
- if (errno == ERANGE) {
|
||||||
|
- len *= 2;
|
||||||
|
- continue;
|
||||||
|
- }
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
- for (i = 0; i < len*BITS_PER_LONG; i++)
|
||||||
|
+ cpus = numa_bitmask_alloc(conf_cpus);
|
||||||
|
+ err = numa_node_to_cpus(node, cpus);
|
||||||
|
+ if (err >= 0)
|
||||||
|
+ for (i = 0; i < conf_cpus; i++)
|
||||||
|
if (numa_bitmask_isbitset(cpus, i))
|
||||||
|
printf(" %d", i);
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
putchar('\n');
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jan 28 18:32:07 CET 2009 - bwalle@suse.de
|
||||||
|
|
||||||
|
- Fixes the function to print all available CPUs.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jan 26 11:06:25 CET 2009 - cthiel@suse.de
|
Mon Jan 26 11:06:25 CET 2009 - cthiel@suse.de
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ Name: numactl
|
|||||||
License: GPL v2 only; GPL v2 or later
|
License: GPL v2 only; GPL v2 or later
|
||||||
Summary: NUMA Policy Control
|
Summary: NUMA Policy Control
|
||||||
Version: 2.0.2_2.0.3rc1
|
Version: 2.0.2_2.0.3rc1
|
||||||
Release: 2
|
Release: 3
|
||||||
%define origversion 2.0.3-rc1
|
%define origversion 2.0.3-rc1
|
||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
# bug437293
|
# bug437293
|
||||||
@ -32,6 +32,7 @@ Obsoletes: numactl-64bit
|
|||||||
%endif
|
%endif
|
||||||
#
|
#
|
||||||
Source: numactl-%{origversion}.tar.bz2
|
Source: numactl-%{origversion}.tar.bz2
|
||||||
|
Patch0: numactl-hardware-bits_per_long_cpus.diff
|
||||||
Group: System/Management
|
Group: System/Management
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
ExclusiveArch: ia64 x86_64 ppc64 ppc
|
ExclusiveArch: ia64 x86_64 ppc64 ppc
|
||||||
@ -85,6 +86,7 @@ Authors:
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -n %{name}-%{origversion}
|
%setup -n %{name}-%{origversion}
|
||||||
|
%patch0 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
make CFLAGS="${RPM_OPT_FLAGS}"
|
make CFLAGS="${RPM_OPT_FLAGS}"
|
||||||
@ -122,6 +124,8 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%{_libdir}/lib*so
|
%{_libdir}/lib*so
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jan 28 2009 bwalle@suse.de
|
||||||
|
- Fixes the function to print all available CPUs.
|
||||||
* Mon Jan 26 2009 cthiel@suse.de
|
* Mon Jan 26 2009 cthiel@suse.de
|
||||||
- fix baselibs.conf, to require libnuma1-32bit on ppc
|
- fix baselibs.conf, to require libnuma1-32bit on ppc
|
||||||
* Thu Jan 15 2009 bwalle@suse.de
|
* Thu Jan 15 2009 bwalle@suse.de
|
||||||
|
Loading…
Reference in New Issue
Block a user