import CS numactl-2.0.16-4.el8
This commit is contained in:
parent
b305a9f84d
commit
f202357e11
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
SOURCES/numactl-2.0.12.tar.gz
|
||||
SOURCES/numactl-2.0.16.tar.gz
|
||||
|
@ -1 +1 @@
|
||||
8576ef894d2c4d25adddd792593bcd92e711d86f SOURCES/numactl-2.0.12.tar.gz
|
||||
37ea1a333827f279e940bf0ae55d6897b331f19f SOURCES/numactl-2.0.16.tar.gz
|
||||
|
@ -1,32 +0,0 @@
|
||||
From cd7c78e77dc43fff5dbe2763f1ac83a8b4a6b1c7 Mon Sep 17 00:00:00 2001
|
||||
From: Harish <harish@linux.vnet.ibm.com>
|
||||
Date: Thu, 21 Jun 2018 07:53:10 +0530
|
||||
Subject: [PATCH 1/7] Fix: node_list with memory-less nodes
|
||||
|
||||
Patch adds check to avoid memory-less nodes while traversing till
|
||||
max node, and this also prevents nodes_to_use sysmalloc failure as
|
||||
nodes_to_use is malloc'ed with numa_num_configured_nodes which
|
||||
returns the number of nodes configured with memory.
|
||||
|
||||
Signed-off-by: Harish <harish@linux.vnet.ibm.com>
|
||||
Signed-off-by: Pingfan Liu <piliu@redhat.com>
|
||||
---
|
||||
numademo.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/numademo.c b/numademo.c
|
||||
index b01e995..90d8e84 100644
|
||||
--- a/numademo.c
|
||||
+++ b/numademo.c
|
||||
@@ -307,7 +307,7 @@ void get_node_list()
|
||||
node_to_use = (int *)malloc(numnodes * sizeof(int));
|
||||
max_node = numa_max_node();
|
||||
for (a = 0; a <= max_node; a++) {
|
||||
- if(numa_node_size(a, &free_node_sizes) != -1)
|
||||
+ if (numa_node_size(a, &free_node_sizes) > 0)
|
||||
node_to_use[got_nodes++] = a;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
|
26
SOURCES/0001-fix-typo-in-memhog.8.patch
Normal file
26
SOURCES/0001-fix-typo-in-memhog.8.patch
Normal file
@ -0,0 +1,26 @@
|
||||
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
|
||||
|
@ -1,63 +0,0 @@
|
||||
From 2b190afdbbff875e519e4ae45390bdde11e8e190 Mon Sep 17 00:00:00 2001
|
||||
From: Harish <harish@linux.vnet.ibm.com>
|
||||
Date: Wed, 20 Jun 2018 18:46:55 +0530
|
||||
Subject: [PATCH 2/7] numademo: fix wrong node input
|
||||
|
||||
In few sparse node systems, test fails with invalid argument at
|
||||
set_mempolicy through numa_preferred_node. Patch fixes it by
|
||||
providing a valid wrong node.
|
||||
|
||||
Signed-off-by: Harish <harish@linux.vnet.ibm.com>
|
||||
Signed-off-by: Pingfan Liu <piliu@redhat.com>
|
||||
---
|
||||
numademo.c | 13 ++++++++++---
|
||||
1 file changed, 10 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/numademo.c b/numademo.c
|
||||
index 90d8e84..4d3c058 100644
|
||||
--- a/numademo.c
|
||||
+++ b/numademo.c
|
||||
@@ -298,7 +298,7 @@ int popcnt(unsigned long val)
|
||||
|
||||
int max_node, numnodes;
|
||||
|
||||
-void get_node_list()
|
||||
+int get_node_list()
|
||||
{
|
||||
int a, got_nodes = 0;
|
||||
long free_node_sizes;
|
||||
@@ -310,6 +310,9 @@ void get_node_list()
|
||||
if (numa_node_size(a, &free_node_sizes) > 0)
|
||||
node_to_use[got_nodes++] = a;
|
||||
}
|
||||
+ if(got_nodes != numnodes)
|
||||
+ return -1;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
void test(enum test type)
|
||||
@@ -436,7 +439,7 @@ void test(enum test type)
|
||||
numa_set_localalloc();
|
||||
memtest("local allocation", numa_alloc(msize));
|
||||
|
||||
- numa_set_preferred((node_to_use[i]+1) % numnodes );
|
||||
+ numa_set_preferred(node_to_use[(i + 1) % numnodes]);
|
||||
memtest("setting wrong preferred node", numa_alloc(msize));
|
||||
numa_set_preferred(node_to_use[i]);
|
||||
memtest("setting correct preferred node", numa_alloc(msize));
|
||||
@@ -512,7 +515,11 @@ int main(int ac, char **av)
|
||||
if (!force)
|
||||
exit(1);
|
||||
}
|
||||
- get_node_list();
|
||||
+ if(get_node_list()){
|
||||
+ fprintf(stderr, "Configured Nodes does not match available memory nodes\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
printf("%d nodes available\n", numnodes);
|
||||
fract_nodes = (((numnodes-1)/8)*2) + FRACT_NODES;
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,50 +0,0 @@
|
||||
From c465ca7ca41aa03e755ed71fa0281c620b0d8dc0 Mon Sep 17 00:00:00 2001
|
||||
From: Harish <harish@linux.vnet.ibm.com>
|
||||
Date: Thu, 21 Jun 2018 17:22:36 +0530
|
||||
Subject: [PATCH 3/7] Fix: distance test to include all existing nodes
|
||||
|
||||
The previous implementation did not consider memory-less nodes as
|
||||
numa_num_configured_nodes() returns only nodes with memory and
|
||||
numa_node_size() check is unnecessary for distance check. Hence
|
||||
removed the check for memory.
|
||||
|
||||
Signed-off-by: Harish <harish@linux.vnet.ibm.com>
|
||||
Signed-off-by: Pingfan Liu <piliu@redhat.com>
|
||||
---
|
||||
test/distance.c | 11 +++++------
|
||||
1 file changed, 5 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/test/distance.c b/test/distance.c
|
||||
index fca109f..3471db6 100644
|
||||
--- a/test/distance.c
|
||||
+++ b/test/distance.c
|
||||
@@ -5,21 +5,20 @@
|
||||
|
||||
int main(void)
|
||||
{
|
||||
- int numnodes, maxnode, a, b, got_nodes = 0;
|
||||
+ int maxnode, a, b, got_nodes = 0;
|
||||
int *node_to_use;
|
||||
- long size, free_node_sizes;
|
||||
if (numa_available() < 0) {
|
||||
printf("no numa support in kernel\n");
|
||||
exit(1);
|
||||
}
|
||||
- numnodes = numa_num_configured_nodes();
|
||||
maxnode = numa_max_node();
|
||||
- node_to_use = (int *)malloc(numnodes * sizeof(int));
|
||||
+ node_to_use = (int *)malloc(maxnode * sizeof(int));
|
||||
for (a = 0; a <= maxnode; a++) {
|
||||
- size = numa_node_size(a, &free_node_sizes);
|
||||
- if(size != -1)
|
||||
+ if (numa_bitmask_isbitset(numa_nodes_ptr, a)){
|
||||
node_to_use[got_nodes++] = a;
|
||||
+ }
|
||||
}
|
||||
+
|
||||
for (a = 0; a < got_nodes; a++){
|
||||
printf("%03d: ", node_to_use[a]);
|
||||
if (numa_distance(node_to_use[a], node_to_use[a]) != 10) {
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,122 +0,0 @@
|
||||
From 09d294e8d83151fb76a7fc741bc6251c0b171e25 Mon Sep 17 00:00:00 2001
|
||||
From: Harish <harish@linux.vnet.ibm.com>
|
||||
Date: Wed, 27 Jun 2018 22:29:10 +0530
|
||||
Subject: [PATCH 4/7] Fix: regress test numastat function and few test fixes
|
||||
|
||||
nstat function previously assumed node indexes to be contiguous
|
||||
and get the numastat of the required statname. When run on a
|
||||
machine with combinations of memory/memory-less nodes in a
|
||||
non-contiguous way, the test fetches wrong stats and fails. This
|
||||
patch finds the index of the given node and returns proper value.
|
||||
|
||||
Signed-off-by: Harish <harish@linux.vnet.ibm.com>
|
||||
Signed-off-by: Pingfan Liu <piliu@redhat.com>
|
||||
---
|
||||
test/regress | 42 +++++++++++++++++++++---------------------
|
||||
1 file changed, 21 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/test/regress b/test/regress
|
||||
index c0cf6d7..f06b22f 100755
|
||||
--- a/test/regress
|
||||
+++ b/test/regress
|
||||
@@ -47,9 +47,11 @@ failed() {
|
||||
# nstat statname node
|
||||
nstat() {
|
||||
sleep $STAT_INTERVAL
|
||||
+ nid=node$2
|
||||
+ id=`numastat | head -1 | awk -v node=$nid '{ for (i = 1; i <= NF; ++i) if($i==node) print i; exit }'`
|
||||
declare -a fields
|
||||
numastat | grep $1 | while read -a fields ; do
|
||||
- echo ${fields[$[1 + $2]]}
|
||||
+ echo ${fields[$id]}
|
||||
done
|
||||
}
|
||||
|
||||
@@ -89,14 +91,13 @@ _test_process_state() {
|
||||
test_process_state()
|
||||
{
|
||||
declare -i n0=${node[0]} n1=${node[1]}
|
||||
-
|
||||
_test_process_state --interleave=$n1
|
||||
|
||||
- a0=`nstat interleave_hit 0`
|
||||
- a1=`nstat interleave_hit 1`
|
||||
+ a0=`nstat interleave_hit $n0`
|
||||
+ a1=`nstat interleave_hit $n1`
|
||||
_test_process_state --interleave=$n0,$n1
|
||||
- b0=`nstat interleave_hit 0`
|
||||
- b1=`nstat interleave_hit 1`
|
||||
+ b0=`nstat interleave_hit $n0`
|
||||
+ b1=`nstat interleave_hit $n1`
|
||||
if [ $(expr $b1 - $a1) -lt $HALFPAGES ]; then
|
||||
echo "interleaving test failed $n1 $b1 $a1"
|
||||
failed
|
||||
@@ -109,19 +110,18 @@ test_process_state()
|
||||
_test_process_state --interleave=all
|
||||
_test_process_state --membind=all
|
||||
|
||||
- a=$(expr $(nstat numa_hit 0) + $(nstat numa_hit 1))
|
||||
+ a=$(expr $(nstat numa_hit $n0) + $(nstat numa_hit $n1))
|
||||
_test_process_state --membind=$n0,$n1
|
||||
- b=$(expr $(nstat numa_hit 0) + $(nstat numa_hit 1))
|
||||
+ b=$(expr $(nstat numa_hit $n0) + $(nstat numa_hit $n1))
|
||||
if [ $(expr $b - $a) -lt $PAGES ]; then
|
||||
echo "membind test failed $n1 $b $a ($PAGES)"
|
||||
failed
|
||||
fi
|
||||
|
||||
- for i in $(seq 0 $maxnode) ; do
|
||||
- declare -i ni=${node[$i]}
|
||||
+ for i in "${node[@]}" ; do
|
||||
a=`nstat numa_hit $i`
|
||||
- _test_process_state --membind=$ni
|
||||
- _test_process_state --preferred=$ni
|
||||
+ _test_process_state --membind=$i
|
||||
+ _test_process_state --preferred=$i
|
||||
b=`nstat numa_hit $i`
|
||||
if [ $(expr $b - $a) -lt $DOUBLEPAGES ]; then
|
||||
echo "membind/preferred on node $ni failed $b $a"
|
||||
@@ -143,11 +143,11 @@ test_mbind()
|
||||
{
|
||||
declare -i n0=${node[0]} n1=${node[1]}
|
||||
|
||||
- a0=`nstat interleave_hit 0`
|
||||
- a1=`nstat interleave_hit 1`
|
||||
+ a0=`nstat interleave_hit $n0`
|
||||
+ a1=`nstat interleave_hit $n1`
|
||||
_test_mbind interleave $n0,$n1
|
||||
- b0=`nstat interleave_hit 0`
|
||||
- b1=`nstat interleave_hit 1`
|
||||
+ b0=`nstat interleave_hit $n0`
|
||||
+ b1=`nstat interleave_hit $n1`
|
||||
if [ $(expr $b1 - $a1) -lt $HALFPAGES ]; then
|
||||
echo "interleaving test 2 failed $n1 $b1 $a1 expected $HALFPAGES"
|
||||
failed
|
||||
@@ -159,19 +159,19 @@ test_mbind()
|
||||
|
||||
_test_mbind interleave all
|
||||
|
||||
- a=$(expr $(nstat numa_hit 0) + $(nstat numa_hit 1))
|
||||
+ a=$(expr $(nstat numa_hit $n0) + $(nstat numa_hit $n1))
|
||||
_test_mbind membind $n0,$n1
|
||||
- b=$(expr $(nstat numa_hit 0) + $(nstat numa_hit 1))
|
||||
+ b=$(expr $(nstat numa_hit $n0) + $(nstat numa_hit $n1))
|
||||
if [ $(expr $b - $a) -lt $PAGES ]; then
|
||||
echo "membind test 2 failed $b $a ($PAGES)"
|
||||
failed
|
||||
fi
|
||||
|
||||
- for i in $(seq 0 $maxnode) ; do
|
||||
+ for i in "${node[@]}" ; do
|
||||
declare -i ni=${node[$i]}
|
||||
a=`nstat numa_hit $i`
|
||||
- _test_mbind membind $ni
|
||||
- _test_mbind preferred $ni
|
||||
+ _test_mbind membind $i
|
||||
+ _test_mbind preferred $i
|
||||
b=`nstat numa_hit $i`
|
||||
if [ $(expr $b - $a) -lt $DOUBLEPAGES ]; then
|
||||
echo "membind/preferred test 2 on node $ni failed $b $a"
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,48 +0,0 @@
|
||||
From d1bc1653b3f86b8951b876946a94db681764fa2a Mon Sep 17 00:00:00 2001
|
||||
From: Filipe Brandenburger <filbranden@google.com>
|
||||
Date: Fri, 15 Jun 2018 14:16:23 -0700
|
||||
Subject: [PATCH 5/7] Correct calculation of nr_nodes and re-enable move_pages
|
||||
test
|
||||
|
||||
This was pointed out by @bjsprakash in #8.
|
||||
|
||||
After the bug is corrected, we can re-enable the test in `make check`,
|
||||
since most machines these days will have at least two nodes by default.
|
||||
|
||||
Travis-CI still fails with this test (one node only available), so keep
|
||||
skipping it there.
|
||||
|
||||
Signed-off-by: Pingfan Liu <piliu@redhat.com>
|
||||
---
|
||||
Makefile.am | 1 +
|
||||
test/move_pages.c | 2 +-
|
||||
2 files changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 03b0ab6..1c4266d 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -134,6 +134,7 @@ TESTS = \
|
||||
test/checkaffinity \
|
||||
test/checktopology \
|
||||
test/distance \
|
||||
+ test/move_pages \
|
||||
test/nodemap \
|
||||
test/numademo \
|
||||
test/regress \
|
||||
diff --git a/test/move_pages.c b/test/move_pages.c
|
||||
index 87d9b3e..c5010e2 100644
|
||||
--- a/test/move_pages.c
|
||||
+++ b/test/move_pages.c
|
||||
@@ -28,7 +28,7 @@ int main(int argc, char **argv)
|
||||
|
||||
pagesize = getpagesize();
|
||||
|
||||
- nr_nodes = numa_max_node();
|
||||
+ nr_nodes = numa_max_node() + 1;
|
||||
|
||||
if (nr_nodes < 2) {
|
||||
printf("A minimum of 2 nodes is required for this test.\n");
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,83 +0,0 @@
|
||||
From bad479d2fe1075cfc83ffbd4ad39bcc6e800e7ca Mon Sep 17 00:00:00 2001
|
||||
From: Harish <harish@linux.vnet.ibm.com>
|
||||
Date: Thu, 5 Jul 2018 12:08:33 +0530
|
||||
Subject: [PATCH 6/7] Fix: move_pages test for non-contiguous nodes
|
||||
|
||||
Patch fixes move_pages test for non-contiguous memory nodes and
|
||||
distributed pages among existing memory nodes instead of assuming
|
||||
continuous node IDs.
|
||||
|
||||
Signed-off-by: Harish <harish@linux.vnet.ibm.com>
|
||||
Signed-off-by: Pingfan Liu <piliu@redhat.com>
|
||||
---
|
||||
test/move_pages.c | 28 +++++++++++++++++++++++++---
|
||||
1 file changed, 25 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/test/move_pages.c b/test/move_pages.c
|
||||
index c5010e2..4b207e8 100644
|
||||
--- a/test/move_pages.c
|
||||
+++ b/test/move_pages.c
|
||||
@@ -21,6 +21,24 @@ int *status;
|
||||
int *nodes;
|
||||
int errors;
|
||||
int nr_nodes;
|
||||
+int *node_to_use;
|
||||
+
|
||||
+int get_node_list()
|
||||
+{
|
||||
+ int a, got_nodes = 0, max_node, numnodes;
|
||||
+ long free_node_sizes;
|
||||
+
|
||||
+ numnodes = numa_num_configured_nodes();
|
||||
+ node_to_use = (int *)malloc(numnodes * sizeof(int));
|
||||
+ max_node = numa_max_node();
|
||||
+ for (a = 0; a <= max_node; a++) {
|
||||
+ if (numa_node_size(a, &free_node_sizes) > 0)
|
||||
+ node_to_use[got_nodes++] = a;
|
||||
+ }
|
||||
+ if(got_nodes != numnodes)
|
||||
+ return -1;
|
||||
+ return got_nodes;
|
||||
+}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
@@ -28,12 +46,16 @@ int main(int argc, char **argv)
|
||||
|
||||
pagesize = getpagesize();
|
||||
|
||||
- nr_nodes = numa_max_node() + 1;
|
||||
+ nr_nodes = get_node_list();
|
||||
|
||||
if (nr_nodes < 2) {
|
||||
printf("A minimum of 2 nodes is required for this test.\n");
|
||||
exit(1);
|
||||
}
|
||||
+ if (nr_nodes == -1) {
|
||||
+ printf("Mismatch between congfigured nodes and memory-rich nodes.\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
|
||||
setbuf(stdout, NULL);
|
||||
printf("move_pages() test ......\n");
|
||||
@@ -58,7 +80,7 @@ int main(int argc, char **argv)
|
||||
/* We leave page 2 unallocated */
|
||||
pages[ i * pagesize ] = (char) i;
|
||||
addr[i] = pages + i * pagesize;
|
||||
- nodes[i] = (i % nr_nodes);
|
||||
+ nodes[i] = node_to_use[(i % nr_nodes)];
|
||||
status[i] = -123;
|
||||
}
|
||||
|
||||
@@ -82,7 +104,7 @@ int main(int argc, char **argv)
|
||||
if (i != 2) {
|
||||
if (pages[ i* pagesize ] != (char) i)
|
||||
errors++;
|
||||
- else if (nodes[i] != (i % nr_nodes))
|
||||
+ else if (nodes[i] != node_to_use[(i % nr_nodes)])
|
||||
errors++;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,39 +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 7/7] 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>
|
||||
Signed-off-by: Pingfan Liu <piliu@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]))
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,88 +0,0 @@
|
||||
From ffbc7a05e1777f4a2b3096483519fe5096ecc716 Mon Sep 17 00:00:00 2001
|
||||
From: Sanskriti Sharma <sansharm@redhat.com>
|
||||
Date: Tue, 20 Nov 2018 10:22:06 -0500
|
||||
Subject: [PATCH] memhog: add man page
|
||||
|
||||
Signed-off-by: Sanskriti Sharma <sansharm@redhat.com>
|
||||
---
|
||||
memhog.8 | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 68 insertions(+)
|
||||
create mode 100644 memhog.8
|
||||
|
||||
diff --git a/memhog.8 b/memhog.8
|
||||
new file mode 100644
|
||||
index 0000000..e28e784
|
||||
--- /dev/null
|
||||
+++ b/memhog.8
|
||||
@@ -0,0 +1,68 @@
|
||||
+.TH MEMHOG 8 "2003,2004" "SuSE Labs" "Linux Administrator's Manual"
|
||||
+.SH NAME
|
||||
+memhog \- Allocates memory with policy for testing
|
||||
+.SH SYNOPSIS
|
||||
+.B memhog
|
||||
+[
|
||||
+.B \-r<NUM>
|
||||
+] [
|
||||
+.B size kmg
|
||||
+] [
|
||||
+.B policy nodeset
|
||||
+] [
|
||||
+.B \-f<filename>
|
||||
+]
|
||||
+.SH DESCRIPTION
|
||||
+.B memhog
|
||||
+mmaps a memory region for a given size and sets the numa policy (if specified).
|
||||
+It then updates the memory region for the given number of iterations using memset.
|
||||
+.TS
|
||||
+tab(|);
|
||||
+l l.
|
||||
+-r<num>|Repeat memset NUM times
|
||||
+-f<file>|Open file for mmap backing
|
||||
+-H|Disable transparent hugepages
|
||||
+-size|Allocation size in bytes, may have case-insensitive order
|
||||
+|suffix (G=gigabyte, M=megabyte, K=kilobyte)
|
||||
+.TE
|
||||
+
|
||||
+Supported numa-policies:
|
||||
+.TP
|
||||
+.B interleave
|
||||
+Memory will be allocated using round robin on nodes. When
|
||||
+memory cannot be allocated on the current interleave, target fall back
|
||||
+to other nodes. Multiple nodes may be specified.
|
||||
+.TP
|
||||
+.B membind
|
||||
+Only allocate memory from nodes. Allocation will fail
|
||||
+when there is not enough memory available on these nodes. Multiple
|
||||
+nodes may be specified.
|
||||
+.TP
|
||||
+.B preferred
|
||||
+Preferably allocate memory on node, but if memory cannot be
|
||||
+allocated there fall back to other nodes. This option takes only a
|
||||
+single node number.
|
||||
+.TP
|
||||
+.B default
|
||||
+Memory will be allocated on the local node (the node the
|
||||
+thread is running on)
|
||||
+
|
||||
+.SH EXAMPLES
|
||||
+.TP
|
||||
+# 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
|
||||
+memhog -r4 1G --interleave 0-3
|
||||
+.TP
|
||||
+# Allocate a 1G region, (implicit) default policy, repeat test 8 times
|
||||
+memhog -r8 1G
|
||||
+
|
||||
+.SH AUTHORS
|
||||
+Andi Kleen (ak@suse.de)
|
||||
+
|
||||
+.SH LICENSE
|
||||
+GPL v2
|
||||
+
|
||||
+.SH SEE ALSO
|
||||
+.I mmap(2), memset(3), numactl(8), numastat(8)
|
||||
--
|
||||
2.7.5
|
||||
|
@ -1,33 +0,0 @@
|
||||
From c2b0a955a415c104be0fa1b3118f48f726fd23ea Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
Date: Tue, 9 Jul 2019 16:10:46 +0200
|
||||
Subject: [PATCH] numastat.8: clarify that information relates to resident
|
||||
pages
|
||||
|
||||
The man page gives no hint about whether memory usage information
|
||||
relates to resident pages or virtual memory. The answer may not be
|
||||
obvious to the user, so explicitly mention that only resident pages are
|
||||
counted.
|
||||
|
||||
Suggested-by: Daniele Palumbo <daniele@retaggio.net>
|
||||
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
---
|
||||
numastat.8 | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/numastat.8 b/numastat.8
|
||||
index 4dcddf3..7fbcab2 100644
|
||||
--- a/numastat.8
|
||||
+++ b/numastat.8
|
||||
@@ -54,6 +54,8 @@ Any supplied options or arguments with the \fBnumastat\fP command will
|
||||
significantly change both the content and the format of the display. Specified
|
||||
options will cause display units to change to megabytes of memory, and will
|
||||
change other specific behaviors of \fBnumastat\fP as described below.
|
||||
+.LP
|
||||
+Memory usage information reflects the resident pages on the system.
|
||||
.SH "OPTIONS"
|
||||
.LP
|
||||
.TP
|
||||
--
|
||||
2.7.5
|
||||
|
@ -1,46 +0,0 @@
|
||||
From a47463a72864a76b0557468daf83741632ea4d72 Mon Sep 17 00:00:00 2001
|
||||
From: Patrick Mansfield <patrick.mansfield@cpacketnetworks.com>
|
||||
Date: Mon, 30 Sep 2019 15:59:53 -0700
|
||||
Subject: [PATCH] Fix crashes when using the "--touch" option.
|
||||
|
||||
Fix memory to be mapped read/write, so that the "touch" option can write to it.
|
||||
|
||||
Signed-off-by: Patrick Mansfield <patrick.mansfield@cpacketnetworks.com>
|
||||
---
|
||||
shm.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/shm.c b/shm.c
|
||||
index 260eeff..fb592ed 100644
|
||||
--- a/shm.c
|
||||
+++ b/shm.c
|
||||
@@ -119,7 +119,7 @@ void attach_sysvshm(char *name, char *opt)
|
||||
shmlen = s.shm_segsz;
|
||||
}
|
||||
|
||||
- shmptr = shmat(shmfd, NULL, SHM_RDONLY);
|
||||
+ shmptr = shmat(shmfd, NULL, 0);
|
||||
if (shmptr == (void*)-1)
|
||||
err("shmat");
|
||||
shmptr += shmoffset;
|
||||
@@ -134,7 +134,7 @@ void attach_shared(char *name, char *opt)
|
||||
{
|
||||
struct stat64 st;
|
||||
|
||||
- shmfd = open(name, O_RDONLY);
|
||||
+ shmfd = open(name, O_RDWR);
|
||||
if (shmfd < 0) {
|
||||
errno = 0;
|
||||
if (shmlen == 0)
|
||||
@@ -160,7 +160,7 @@ void attach_shared(char *name, char *opt)
|
||||
|
||||
/* RED-PEN For shmlen > address space may need to map in pieces.
|
||||
Left for some poor 32bit soul. */
|
||||
- shmptr = mmap64(NULL, shmlen, PROT_READ, MAP_SHARED, shmfd, shmoffset);
|
||||
+ shmptr = mmap64(NULL, shmlen, PROT_READ | PROT_WRITE, MAP_SHARED, shmfd, shmoffset);
|
||||
if (shmptr == (char*)-1)
|
||||
err("shm mmap");
|
||||
|
||||
--
|
||||
2.7.5
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 6a41846f3191afe48144481bbfa2fd4edafdc8d5 Mon Sep 17 00:00:00 2001
|
||||
From: Sanskriti Sharma <sansharm@redhat.com>
|
||||
Date: Wed, 21 Nov 2018 10:28:44 -0500
|
||||
Subject: [PATCH] Added memhog.8 to Makefile.am Signed-off-by: Sanskriti Sharma
|
||||
<sansharm@redhat.com>
|
||||
|
||||
---
|
||||
Makefile.am | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 1c4266d..ab61d42 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -12,7 +12,7 @@ include_HEADERS = numa.h numacompat1.h numaif.h
|
||||
|
||||
noinst_HEADERS = numaint.h util.h
|
||||
|
||||
-dist_man_MANS = move_pages.2 numa.3 numactl.8 numastat.8 migratepages.8 migspeed.8
|
||||
+dist_man_MANS = move_pages.2 numa.3 numactl.8 numastat.8 migratepages.8 migspeed.8 memhog.8
|
||||
|
||||
EXTRA_DIST = README.md INSTALL.md
|
||||
|
||||
--
|
||||
2.7.5
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 26fba7199c365b55e72e054bb2adba097ce04924 Mon Sep 17 00:00:00 2001
|
||||
From: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
|
||||
Date: Wed, 8 Jan 2020 14:39:01 +0530
|
||||
Subject: [PATCH] Update manpage description of --localalloc option
|
||||
|
||||
Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
|
||||
---
|
||||
numactl.8 | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/numactl.8 b/numactl.8
|
||||
index 7a001c0..f3bb22b 100644
|
||||
--- a/numactl.8
|
||||
+++ b/numactl.8
|
||||
@@ -159,7 +159,7 @@ A !N-N notation indicates the inverse of N-N, in other words all cpus
|
||||
except N-N. If used with + notation, specify !+N-N.
|
||||
.TP
|
||||
.B \-\-localalloc, \-l
|
||||
-Always allocate on the current node.
|
||||
+Try to allocate on the current node of the process, but if memory cannot be allocated there fall back to other nodes.
|
||||
.TP
|
||||
.B \-\-preferred=node
|
||||
Preferably allocate memory on
|
||||
--
|
||||
2.7.5
|
||||
|
@ -1,35 +0,0 @@
|
||||
From 93867c59b0bb29470873a427dc7f06ebaf305221 Mon Sep 17 00:00:00 2001
|
||||
From: Pingfan Liu <piliu@redhat.com>
|
||||
Date: Mon, 29 Mar 2021 17:33:06 +0800
|
||||
Subject: [PATCH] libnuma: make numa_police_memory() free of race
|
||||
|
||||
When numa_police_memory() read-write to memory, it can risk the race of
|
||||
another thread write to the same area.
|
||||
|
||||
Using atomic function to protect the read-write operation
|
||||
|
||||
Signed-off-by: Pingfan Liu <piliu@redhat.com>
|
||||
---
|
||||
libnuma.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libnuma.c b/libnuma.c
|
||||
index f073c50..7b8290c 100644
|
||||
--- a/libnuma.c
|
||||
+++ b/libnuma.c
|
||||
@@ -864,8 +864,10 @@ void numa_police_memory(void *mem, size_t size)
|
||||
{
|
||||
int pagesize = numa_pagesize_int();
|
||||
unsigned long i;
|
||||
- for (i = 0; i < size; i += pagesize)
|
||||
- ((volatile char*)mem)[i] = ((volatile char*)mem)[i];
|
||||
+ char *p = mem;
|
||||
+ for (i = 0; i < size; i += pagesize, p += pagesize)
|
||||
+ __atomic_and_fetch(p, 0xff, __ATOMIC_RELAXED);
|
||||
+
|
||||
}
|
||||
|
||||
make_internal_alias(numa_police_memory);
|
||||
--
|
||||
2.29.2
|
||||
|
@ -1,7 +1,7 @@
|
||||
Name: numactl
|
||||
Summary: Library for tuning for Non Uniform Memory Access machines
|
||||
Version: 2.0.12
|
||||
Release: 13%{?dist}
|
||||
Version: 2.0.16
|
||||
Release: 4%{?dist}
|
||||
# libnuma is LGPLv2 and GPLv2
|
||||
# numactl binaries are GPLv2 only
|
||||
License: GPLv2
|
||||
@ -37,19 +37,7 @@ ExcludeArch: s390 %{arm}
|
||||
#
|
||||
# Patches 601 onward are generic patches
|
||||
#
|
||||
Patch601 :0001-Fix-node_list-with-memory-less-nodes.patch
|
||||
Patch602 :0002-numademo-fix-wrong-node-input.patch
|
||||
Patch603 :0003-Fix-distance-test-to-include-all-existing-nodes.patch
|
||||
Patch604 :0004-Fix-regress-test-numastat-function-and-few-test-fixe.patch
|
||||
Patch605 :0005-Correct-calculation-of-nr_nodes-and-re-enable-move_p.patch
|
||||
Patch606 :0006-Fix-move_pages-test-for-non-contiguous-nodes.patch
|
||||
Patch607 :0007-Fix-Add-ShmemHugePages-and-ShmemPmdMapped-to-system_.patch
|
||||
Patch608 :0008-memhog-add-man-page.patch
|
||||
Patch609: 0009-numastat.8-clarify-that-information-relates-to-resid.patch
|
||||
Patch610: 0010-Fix-crashes-when-using-the-touch-option.patch
|
||||
Patch611: 0011-Added-memhog.8-to-Makefile.am.patch
|
||||
Patch612: 0012-Update-manpage-description-of-localalloc-option.patch
|
||||
Patch613: 0013-libnuma-make-numa_police_memory-free-of-race.patch
|
||||
Patch601: 0001-fix-typo-in-memhog.8.patch
|
||||
|
||||
|
||||
|
||||
@ -81,18 +69,6 @@ Provides development headers for numa library calls
|
||||
|
||||
#patch
|
||||
%patch601 -p1
|
||||
%patch602 -p1
|
||||
%patch603 -p1
|
||||
%patch604 -p1
|
||||
%patch605 -p1
|
||||
%patch606 -p1
|
||||
%patch607 -p1
|
||||
%patch608 -p1
|
||||
%patch609 -p1
|
||||
%patch610 -p1
|
||||
%patch611 -p1
|
||||
%patch612 -p1
|
||||
%patch613 -p1
|
||||
|
||||
|
||||
%build
|
||||
@ -138,6 +114,10 @@ make DESTDIR=$RPM_BUILD_ROOT install
|
||||
%{_mandir}/man3/*.3*
|
||||
|
||||
%changelog
|
||||
* Thu Sep 14 2023 Pingfan Liu <piliu@redhat.com> - 2.0.16-2
|
||||
- fix typo in memhog.8
|
||||
- Remove contained patches
|
||||
|
||||
* Wed May 12 2021 Pingfan Liu <piliu@redhat.com> - 2.0.12-13
|
||||
- libnuma: make numa_police_memory() free of race
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user