!1 upgrade version to 2.0.13

Merge pull request !1 from HukunaMatata/upgrade
This commit is contained in:
openeuler-ci-bot 2020-01-11 10:37:41 +08:00 committed by Gitee
commit f022723234
11 changed files with 6 additions and 323 deletions

View File

@ -1,38 +0,0 @@
From a8f5ed65b745f96f5e5af72bace8e7c63b96fd4e Mon Sep 17 00:00:00 2001
From: Sanskriti Sharma <sansharm@redhat.com>
Date: Thu, 13 Sep 2018 10:01:58 -0400
Subject: [PATCH 07/25] Fix: Add ShmemHugePages and ShmemPmdMapped to
system_meminfo[]
ShmemHugePages and ShmemPmdMapped were recently added to
/sys/devices/system/node/node*/meminfo. Adding entries for them in the
system_meminfo data structure got rid of the error "Token Node not in hash
table."
Signed-off-by: Sanskriti Sharma <sansharm@redhat.com>
---
numastat.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/numastat.c b/numastat.c
index 92d8496..25874db 100644
--- a/numastat.c
+++ b/numastat.c
@@ -122,9 +122,11 @@ meminfo_t system_meminfo[] = {
{ 27, "SReclaimable", "SReclaimable" },
{ 28, "SUnreclaim", "SUnreclaim" },
{ 29, "AnonHugePages", "AnonHugePages" },
- { 30, "HugePages_Total", "HugePages_Total" },
- { 31, "HugePages_Free", "HugePages_Free" },
- { 32, "HugePages_Surp", "HugePages_Surp" }
+ { 30, "ShmemHugePages", "ShmemHugePages" },
+ { 31, "ShmemPmdMapped", "ShmemPmdMapped" },
+ { 32, "HugePages_Total", "HugePages_Total" },
+ { 33, "HugePages_Free", "HugePages_Free" },
+ { 34, "HugePages_Surp", "HugePages_Surp" }
};
#define SYSTEM_MEMINFO_ROWS (sizeof(system_meminfo) / sizeof(system_meminfo[0]))
--
1.8.3.1

View File

@ -1,29 +0,0 @@
From b4072cd7add189dae02f3787cbc6a9e65f0326e7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Neto?= <joao@neto.pt>
Date: Thu, 4 Oct 2018 09:55:00 +0100
Subject: [PATCH 08/25] add missing policy
`MPOL_LOCAL` has been a policy since Linux 3.8, but is missing from `numaif.h`
---
numaif.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/numaif.h b/numaif.h
index 2c9f214..de58097 100644
--- a/numaif.h
+++ b/numaif.h
@@ -23,9 +23,10 @@ extern long move_pages(int pid, unsigned long count,
/* Policies */
#define MPOL_DEFAULT 0
-#define MPOL_PREFERRED 1
+#define MPOL_PREFERRED 1
#define MPOL_BIND 2
#define MPOL_INTERLEAVE 3
+#define MPOL_LOCAL 4
#define MPOL_MAX MPOL_INTERLEAVE
--
1.8.3.1

View File

@ -1,29 +0,0 @@
From a7ee1fcdae89c17721a12240d4d6b775820b60ed Mon Sep 17 00:00:00 2001
From: Sanskriti Sharma <sansharm@redhat.com>
Date: Tue, 9 Oct 2018 15:08:12 -0400
Subject: [PATCH 13/25] numactl: add va_end to usage function
Fixes the following cppcheck:
[numactl.c:104]: (error) va_list 'ap' was opened but not closed by va_end().
Signed-off-by: Sanskriti Sharma <sansharm@redhat.com>
---
numactl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/numactl.c b/numactl.c
index a2b2d9d..76a1cca 100644
--- a/numactl.c
+++ b/numactl.c
@@ -101,6 +101,7 @@ void usage_msg(char *msg, ...)
vfprintf(stderr, msg, ap);
putchar('\n');
usage();
+ va_end(ap);
}
void show_physcpubind(void)
--
1.8.3.1

View File

@ -1,84 +0,0 @@
From 24514624d5d3121884344b2847b0e50204b2ffb8 Mon Sep 17 00:00:00 2001
From: Sanskriti Sharma <sansharm@redhat.com>
Date: Tue, 9 Oct 2018 15:15:25 -0400
Subject: [PATCH 14/25] libnuma: cleanup node cpu mask in destructor
Free node_cpu_mask_v2[] bitmap-pointer-array and all of the bitmaps
that it points to.
Fixes the following valgrind warnings:
16 bytes in 1 blocks are still reachable in loss record 1 of 3
at 0x4C28BE3: malloc (vg_replace_malloc.c:299)
by 0x4E37E05: numa_bitmask_alloc (libnuma.c:210)
by 0x4E3998E: numa_node_to_cpus@@libnuma_1.2 (libnuma.c:1381)
by 0x4E3A3C9: numa_run_on_node (libnuma.c:1718)
by 0x402DB5: test (in /home/sansharm/src/numactl/.libs/numademo)
by 0x401672: main (in /home/sansharm/src/numactl/.libs/numademo)
512 bytes in 1 blocks are still reachable in loss record 2 of 3
at 0x4C2A975: calloc (vg_replace_malloc.c:711)
by 0x4E37E24: numa_bitmask_alloc (libnuma.c:214)
by 0x4E3998E: numa_node_to_cpus@@libnuma_1.2 (libnuma.c:1381)
by 0x4E3A3C9: numa_run_on_node (libnuma.c:1718)
by 0x402DB5: test (in /home/sansharm/src/numactl/.libs/numademo)
by 0x401672: main (in /home/sansharm/src/numactl/.libs/numademo)
8,192 bytes in 1 blocks are still reachable in loss record 3 of 3
at 0x4C2A975: calloc (vg_replace_malloc.c:711)
by 0x4E39974: init_node_cpu_mask_v2 (libnuma.c:1266)
by 0x4E39974: numa_node_to_cpus@@libnuma_1.2 (libnuma.c:1361)
by 0x4E3A3C9: numa_run_on_node (libnuma.c:1718)
by 0x402DB5: test (in /home/sansharm/src/numactl/.libs/numademo)
by 0x401672: main (in /home/sansharm/src/numactl/.libs/numademo)
Signed-off-by:Sanskriti Sharma <sansharm@redhat.com>
---
libnuma.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/libnuma.c b/libnuma.c
index eb99567..658ee00 100644
--- a/libnuma.c
+++ b/libnuma.c
@@ -103,6 +103,8 @@ numa_init(void)
memset(&numa_no_nodes, 0, sizeof(numa_no_nodes));
}
+static void cleanup_node_cpu_mask_v2();
+
#define FREE_AND_ZERO(x) if (x) { \
numa_bitmask_free(x); \
x = NULL; \
@@ -118,6 +120,7 @@ numa_fini(void)
FREE_AND_ZERO(numa_no_nodes_ptr);
FREE_AND_ZERO(numa_memnode_ptr);
FREE_AND_ZERO(numa_nodes_ptr);
+ cleanup_node_cpu_mask_v2();
}
/*
@@ -1248,6 +1251,20 @@ static init_node_cpu_mask_v2(void)
node_cpu_mask_v2 = calloc (nnodes, sizeof(struct bitmask *));
}
+static void cleanup_node_cpu_mask_v2(void)
+{
+ if (node_cpu_mask_v2) {
+ int i;
+ int nnodes;
+ nnodes = numa_max_possible_node_v2_int() + 1;
+ for (i = 0; i < nnodes; i++) {
+ FREE_AND_ZERO(node_cpu_mask_v2[i]);
+ }
+ free(node_cpu_mask_v2);
+ node_cpu_mask_v2 = NULL;
+ }
+}
+
/* This would be better with some locking, but I don't want to make libnuma
dependent on pthreads right now. The races are relatively harmless. */
int
--
1.8.3.1

View File

@ -1,25 +0,0 @@
From 9555fd2c5c700e774620017fa611c864fc3c8f2a Mon Sep 17 00:00:00 2001
From: Sanskriti Sharma <sansharm@redhat.com>
Date: Wed, 28 Nov 2018 10:12:26 -0500
Subject: [PATCH 21/25] Removed unnecessary exit from memhog.c Solves issue #50
Signed-off-by: Sanskriti sharma <sansharm@redhat.com>
---
memhog.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/memhog.c b/memhog.c
index e832266..829b393 100644
--- a/memhog.c
+++ b/memhog.c
@@ -101,7 +101,6 @@ int main(int ac, char **av)
length = memsize(av[1]);
if (av[2] && numa_available() < 0) {
printf("Kernel doesn't support NUMA policy\n");
- exit(1);
} else
loose = 1;
policy = parse_policy(av[2], av[3]);
--
1.8.3.1

View File

@ -1,38 +0,0 @@
From 4fda899f78887c782ba1dc6613d0b7b635aee535 Mon Sep 17 00:00:00 2001
From: Gareth Lloyd <gareth@ignition-web.co.uk>
Date: Fri, 4 Jan 2019 13:58:58 +0000
Subject: [PATCH 22/25] Correct sysconf constants
Only level 1 distinguishes between data and intstruction cache
---
clearcache.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/clearcache.c b/clearcache.c
index 82469c1..146051c 100644
--- a/clearcache.c
+++ b/clearcache.c
@@ -14,14 +14,14 @@ unsigned cache_size(void)
#ifdef _SC_LEVEL1_DCACHE_SIZE
cs += sysconf(_SC_LEVEL1_DCACHE_SIZE);
#endif
-#ifdef _SC_LEVEL2_DCACHE_SIZE
- cs += sysconf(_SC_LEVEL2_DCACHE_SIZE);
+#ifdef _SC_LEVEL2_CACHE_SIZE
+ cs += sysconf(_SC_LEVEL2_CACHE_SIZE);
#endif
-#ifdef _SC_LEVEL3_DCACHE_SIZE
- cs += sysconf(_SC_LEVEL3_DCACHE_SIZE);
+#ifdef _SC_LEVEL3_CACHE_SIZE
+ cs += sysconf(_SC_LEVEL3_CACHE_SIZE);
#endif
-#ifdef _SC_LEVEL4_DCACHE_SIZE
- cs += sysconf(_SC_LEVEL4_DCACHE_SIZE);
+#ifdef _SC_LEVEL4_CACHE_SIZE
+ cs += sysconf(_SC_LEVEL4_CACHE_SIZE);
#endif
if (cs == 0) {
static int warned;
--
1.8.3.1

View File

@ -1,35 +0,0 @@
From ec4fa9fe01d0735f9440ef69e1a5a1cca63bf78e Mon Sep 17 00:00:00 2001
From: Tony Luck <tony.luck@intel.com>
Date: Fri, 25 Jan 2019 15:15:34 -0800
Subject: [PATCH 24/25] numastat: Better diagnostic when find unknown string in
meminfo
From time to time the kernel adds new statistics to the meminfo
file. These currently result in messages like this:
Token Node not in hash table.
it would be more helpful to print the actual token that was found,
rather than the word "Node". E.g.
Token KReclaimable not in hash table.
---
numastat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/numastat.c b/numastat.c
index 25874db..1ae11fb 100644
--- a/numastat.c
+++ b/numastat.c
@@ -824,7 +824,7 @@ void show_info_from_system_file(char *file, meminfo_p meminfo, int meminfo_rows,
// example line from meminfo file: "Node 3 Inactive: 210680 kB"
int index = hash_lookup(tok[0 + tok_offset]);
if (index < 0) {
- printf("Token %s not in hash table.\n", tok[0]);
+ printf("Token %s not in hash table.\n", tok[0 + tok_offset]);
} else {
double value = (double)atol(tok[1 + tok_offset]);
if (!compatibility_mode) {
--
1.8.3.1

View File

@ -1,33 +0,0 @@
From ebec09d9f6c6d8ab268472347bbe7f94659d7275 Mon Sep 17 00:00:00 2001
From: Tony Luck <tony.luck@intel.com>
Date: Fri, 25 Jan 2019 15:22:34 -0800
Subject: [PATCH 25/25] numastat: Add KReclaimable to list of known fields in
meminfo
Linux kernel added this new field in October 2018 version v4.20
with commit:
61f94e18de94 ("mm, proc: add KReclaimable to /proc/meminfo")
Add it to numastat too.
---
numastat.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/numastat.c b/numastat.c
index 1ae11fb..263bddf 100644
--- a/numastat.c
+++ b/numastat.c
@@ -126,7 +126,8 @@ meminfo_t system_meminfo[] = {
{ 31, "ShmemPmdMapped", "ShmemPmdMapped" },
{ 32, "HugePages_Total", "HugePages_Total" },
{ 33, "HugePages_Free", "HugePages_Free" },
- { 34, "HugePages_Surp", "HugePages_Surp" }
+ { 34, "HugePages_Surp", "HugePages_Surp" },
+ { 35, "KReclaimable", "KReclaimable" }
};
#define SYSTEM_MEMINFO_ROWS (sizeof(system_meminfo) / sizeof(system_meminfo[0]))
--
1.8.3.1

Binary file not shown.

BIN
numactl-2.0.13.tar.gz Normal file

Binary file not shown.

View File

@ -1,21 +1,12 @@
Name: numactl
Version: 2.0.12
Release: 3
Version: 2.0.13
Release: 4
Summary: Library for tuning for Non Uniform Memory Access machines
License: GPLv2
URL: https://github.com/numactl/numactl
Source0: https://github.com/numactl/numactl/releases/download/v2.0.12/numactl-2.0.12.tar.gz
Source0: https://github.com/numactl/numactl/releases/download/v%{version}/numactl-%{version}.tar.gz
BuildRequires: libtool automake autoconf git
Patch6000: 0007-Fix-Add-ShmemHugePages-and-ShmemPmdMapped-to-system_.patch
Patch6001: 0008-add-missing-policy.patch
Patch6002: 0013-numactl-add-va_end-to-usage-function.patch
Patch6003: 0014-libnuma-cleanup-node-cpu-mask-in-destructor.patch
Patch6004: 0021-Removed-unnecessary-exit-from-memhog.c.patch
Patch6005: 0022-Correct-sysconf-constants.patch
Patch6006: 0024-numastat-Better-diagnostic-when-find-unknown-string-.patch
Patch6007: 0025-numastat-Add-KReclaimable-to-list-of-known-fields-in.patch
%description
Simple NUMA policy support. It consists of a numactl program to run other
programs with a specific NUMA policy and a libnuma shared library to set
@ -78,6 +69,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man3/*.3*
%changelog
* Fri Jan 10 2020 yuxiangyang<yuxiangyang4@huawei.com> - 2.0.13-4
- upgrade version to 2.0.13
* Fri Dec 20 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.0.12-3
- Fix ldconfig scriptlets