Blame SOURCES/cb2e8d2-test-limit-number-of-arenas-in-vmem_stats.patch

5cd9d2
test: limit number of arenas in vmem_stats
5cd9d2
5cd9d2
BZ: 1383467
5cd9d2
5cd9d2
commit cb2e8d2590520463bf43453dab1c38fa6d1e0747
5cd9d2
Author: Krzysztof Czurylo <krzysztof.czurylo@intel.com>
5cd9d2
Date:   Fri Mar 17 15:50:53 2017 +0100
5cd9d2
5cd9d2
    test: limit number of arenas in vmem_stats
5cd9d2
    
5cd9d2
    By default, jemalloc allocates 4 * num_of_cpu arenas. If statistics
5cd9d2
    are enabled, it also allocates the corresponding per-arena stat
5cd9d2
    structures for all the arenas, even if only one arena is actually used
5cd9d2
    (single-threaded program).  If this test is run on a machine with
5cd9d2
    the number of cores >=64, the amount of memory required to keep all
5cd9d2
    the statistics is larger than the usable space of the pool.
5cd9d2
    
5cd9d2
    The easiest workaround is to limit the number of arenas for this test
5cd9d2
    by setting JE_VMEM_MALLOC_CONF environment variable.  Thus, the test can
5cd9d2
    be run on any machine and we don't need to calculate the pool size
5cd9d2
    based on number of available CPU cores.
5cd9d2
    
5cd9d2
    Backported from master (ccbf4cb).
5cd9d2
5cd9d2
diff --git a/src/test/vmem_stats/TEST0 b/src/test/vmem_stats/TEST0
5cd9d2
index 5e11b9a..6f180b6 100755
5cd9d2
--- a/src/test/vmem_stats/TEST0
5cd9d2
+++ b/src/test/vmem_stats/TEST0
5cd9d2
@@ -1,6 +1,6 @@
5cd9d2
 #!/bin/bash -e
5cd9d2
 #
5cd9d2
-# Copyright 2014-2016, Intel Corporation
5cd9d2
+# Copyright 2014-2017, Intel Corporation
5cd9d2
 #
5cd9d2
 # Redistribution and use in source and binary forms, with or without
5cd9d2
 # modification, are permitted provided that the following conditions
5cd9d2
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
5cd9d2
 
5cd9d2
 setup
5cd9d2
 
5cd9d2
+# limit the number of arenas to fit into the minimal VMEM pool size
5cd9d2
+export JE_VMEM_MALLOC_CONF="narenas:64"
5cd9d2
+
5cd9d2
 expect_normal_exit ./vmem_stats$EXESUFFIX 0
5cd9d2
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
5cd9d2
 
5cd9d2
diff --git a/src/test/vmem_stats/TEST1 b/src/test/vmem_stats/TEST1
5cd9d2
index bfabb87..1deb947 100755
5cd9d2
--- a/src/test/vmem_stats/TEST1
5cd9d2
+++ b/src/test/vmem_stats/TEST1
5cd9d2
@@ -1,6 +1,6 @@
5cd9d2
 #!/bin/bash -e
5cd9d2
 #
5cd9d2
-# Copyright 2014-2016, Intel Corporation
5cd9d2
+# Copyright 2014-2017, Intel Corporation
5cd9d2
 #
5cd9d2
 # Redistribution and use in source and binary forms, with or without
5cd9d2
 # modification, are permitted provided that the following conditions
5cd9d2
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
5cd9d2
 
5cd9d2
 setup
5cd9d2
 
5cd9d2
+# limit the number of arenas to fit into the minimal VMEM pool size
5cd9d2
+export JE_VMEM_MALLOC_CONF="narenas:64"
5cd9d2
+
5cd9d2
 expect_normal_exit ./vmem_stats$EXESUFFIX 0 g
5cd9d2
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
5cd9d2
 
5cd9d2
diff --git a/src/test/vmem_stats/TEST2 b/src/test/vmem_stats/TEST2
5cd9d2
index 776e938..729a315 100755
5cd9d2
--- a/src/test/vmem_stats/TEST2
5cd9d2
+++ b/src/test/vmem_stats/TEST2
5cd9d2
@@ -1,6 +1,6 @@
5cd9d2
 #!/bin/bash -e
5cd9d2
 #
5cd9d2
-# Copyright 2014-2016, Intel Corporation
5cd9d2
+# Copyright 2014-2017, Intel Corporation
5cd9d2
 #
5cd9d2
 # Redistribution and use in source and binary forms, with or without
5cd9d2
 # modification, are permitted provided that the following conditions
5cd9d2
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
5cd9d2
 
5cd9d2
 setup
5cd9d2
 
5cd9d2
+# limit the number of arenas to fit into the minimal VMEM pool size
5cd9d2
+export JE_VMEM_MALLOC_CONF="narenas:64"
5cd9d2
+
5cd9d2
 expect_normal_exit ./vmem_stats$EXESUFFIX 0 gbl
5cd9d2
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
5cd9d2
 
5cd9d2
diff --git a/src/test/vmem_stats/TEST3 b/src/test/vmem_stats/TEST3
5cd9d2
index 3bfb975..99ac9f4 100755
5cd9d2
--- a/src/test/vmem_stats/TEST3
5cd9d2
+++ b/src/test/vmem_stats/TEST3
5cd9d2
@@ -1,6 +1,6 @@
5cd9d2
 #!/bin/bash -e
5cd9d2
 #
5cd9d2
-# Copyright 2014-2016, Intel Corporation
5cd9d2
+# Copyright 2014-2017, Intel Corporation
5cd9d2
 #
5cd9d2
 # Redistribution and use in source and binary forms, with or without
5cd9d2
 # modification, are permitted provided that the following conditions
5cd9d2
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
5cd9d2
 
5cd9d2
 setup
5cd9d2
 
5cd9d2
+# limit the number of arenas to fit into the minimal VMEM pool size
5cd9d2
+export JE_VMEM_MALLOC_CONF="narenas:64"
5cd9d2
+
5cd9d2
 expect_normal_exit ./vmem_stats$EXESUFFIX 0 gbla
5cd9d2
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
5cd9d2
 
5cd9d2
diff --git a/src/test/vmem_stats/TEST4 b/src/test/vmem_stats/TEST4
5cd9d2
index b310590..779fe86 100755
5cd9d2
--- a/src/test/vmem_stats/TEST4
5cd9d2
+++ b/src/test/vmem_stats/TEST4
5cd9d2
@@ -1,6 +1,6 @@
5cd9d2
 #!/bin/bash -e
5cd9d2
 #
5cd9d2
-# Copyright 2014-2016, Intel Corporation
5cd9d2
+# Copyright 2014-2017, Intel Corporation
5cd9d2
 #
5cd9d2
 # Redistribution and use in source and binary forms, with or without
5cd9d2
 # modification, are permitted provided that the following conditions
5cd9d2
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
5cd9d2
 
5cd9d2
 setup
5cd9d2
 
5cd9d2
+# limit the number of arenas to fit into the minimal VMEM pool size
5cd9d2
+export JE_VMEM_MALLOC_CONF="narenas:64"
5cd9d2
+
5cd9d2
 expect_normal_exit ./vmem_stats$EXESUFFIX 0 gblma
5cd9d2
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
5cd9d2
 
5cd9d2
diff --git a/src/test/vmem_stats/TEST5 b/src/test/vmem_stats/TEST5
5cd9d2
index 5524b69..8d39f1a 100755
5cd9d2
--- a/src/test/vmem_stats/TEST5
5cd9d2
+++ b/src/test/vmem_stats/TEST5
5cd9d2
@@ -1,6 +1,6 @@
5cd9d2
 #!/bin/bash -e
5cd9d2
 #
5cd9d2
-# Copyright 2014-2016, Intel Corporation
5cd9d2
+# Copyright 2014-2017, Intel Corporation
5cd9d2
 #
5cd9d2
 # Redistribution and use in source and binary forms, with or without
5cd9d2
 # modification, are permitted provided that the following conditions
5cd9d2
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
5cd9d2
 
5cd9d2
 setup
5cd9d2
 
5cd9d2
+# limit the number of arenas to fit into the minimal VMEM pool size
5cd9d2
+export JE_VMEM_MALLOC_CONF="narenas:64"
5cd9d2
+
5cd9d2
 expect_normal_exit ./vmem_stats$EXESUFFIX 1
5cd9d2
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
5cd9d2
 
5cd9d2
diff --git a/src/test/vmem_stats/TEST6 b/src/test/vmem_stats/TEST6
5cd9d2
index 6a6b8c7..3fc0a3a 100755
5cd9d2
--- a/src/test/vmem_stats/TEST6
5cd9d2
+++ b/src/test/vmem_stats/TEST6
5cd9d2
@@ -1,6 +1,6 @@
5cd9d2
 #!/bin/bash -e
5cd9d2
 #
5cd9d2
-# Copyright 2014-2016, Intel Corporation
5cd9d2
+# Copyright 2014-2017, Intel Corporation
5cd9d2
 #
5cd9d2
 # Redistribution and use in source and binary forms, with or without
5cd9d2
 # modification, are permitted provided that the following conditions
5cd9d2
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
5cd9d2
 
5cd9d2
 setup
5cd9d2
 
5cd9d2
+# limit the number of arenas to fit into the minimal VMEM pool size
5cd9d2
+export JE_VMEM_MALLOC_CONF="narenas:64"
5cd9d2
+
5cd9d2
 expect_normal_exit ./vmem_stats$EXESUFFIX 1 g
5cd9d2
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
5cd9d2
 
5cd9d2
diff --git a/src/test/vmem_stats/TEST7 b/src/test/vmem_stats/TEST7
5cd9d2
index f9f1545..c7d4d5c 100755
5cd9d2
--- a/src/test/vmem_stats/TEST7
5cd9d2
+++ b/src/test/vmem_stats/TEST7
5cd9d2
@@ -1,6 +1,6 @@
5cd9d2
 #!/bin/bash -e
5cd9d2
 #
5cd9d2
-# Copyright 2014-2016, Intel Corporation
5cd9d2
+# Copyright 2014-2017, Intel Corporation
5cd9d2
 #
5cd9d2
 # Redistribution and use in source and binary forms, with or without
5cd9d2
 # modification, are permitted provided that the following conditions
5cd9d2
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
5cd9d2
 
5cd9d2
 setup
5cd9d2
 
5cd9d2
+# limit the number of arenas to fit into the minimal VMEM pool size
5cd9d2
+export JE_VMEM_MALLOC_CONF="narenas:64"
5cd9d2
+
5cd9d2
 expect_normal_exit ./vmem_stats$EXESUFFIX 1 gbl
5cd9d2
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
5cd9d2
 
5cd9d2
diff --git a/src/test/vmem_stats/TEST8 b/src/test/vmem_stats/TEST8
5cd9d2
index 07c0e08..33509cc 100755
5cd9d2
--- a/src/test/vmem_stats/TEST8
5cd9d2
+++ b/src/test/vmem_stats/TEST8
5cd9d2
@@ -1,6 +1,6 @@
5cd9d2
 #!/bin/bash -e
5cd9d2
 #
5cd9d2
-# Copyright 2014-2016, Intel Corporation
5cd9d2
+# Copyright 2014-2017, Intel Corporation
5cd9d2
 #
5cd9d2
 # Redistribution and use in source and binary forms, with or without
5cd9d2
 # modification, are permitted provided that the following conditions
5cd9d2
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
5cd9d2
 
5cd9d2
 setup
5cd9d2
 
5cd9d2
+# limit the number of arenas to fit into the minimal VMEM pool size
5cd9d2
+export JE_VMEM_MALLOC_CONF="narenas:64"
5cd9d2
+
5cd9d2
 expect_normal_exit ./vmem_stats$EXESUFFIX 1 gbla
5cd9d2
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
5cd9d2
 
5cd9d2
diff --git a/src/test/vmem_stats/TEST9 b/src/test/vmem_stats/TEST9
5cd9d2
index b67f261..085835e 100755
5cd9d2
--- a/src/test/vmem_stats/TEST9
5cd9d2
+++ b/src/test/vmem_stats/TEST9
5cd9d2
@@ -1,6 +1,6 @@
5cd9d2
 #!/bin/bash -e
5cd9d2
 #
5cd9d2
-# Copyright 2014-2016, Intel Corporation
5cd9d2
+# Copyright 2014-2017, Intel Corporation
5cd9d2
 #
5cd9d2
 # Redistribution and use in source and binary forms, with or without
5cd9d2
 # modification, are permitted provided that the following conditions
5cd9d2
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
5cd9d2
 
5cd9d2
 setup
5cd9d2
 
5cd9d2
+# limit the number of arenas to fit into the minimal VMEM pool size
5cd9d2
+export JE_VMEM_MALLOC_CONF="narenas:64"
5cd9d2
+
5cd9d2
 expect_normal_exit ./vmem_stats$EXESUFFIX 1 gblma
5cd9d2
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
5cd9d2