Blob Blame History Raw
test: limit number of arenas in vmem_stats

BZ: 1383467

commit cb2e8d2590520463bf43453dab1c38fa6d1e0747
Author: Krzysztof Czurylo <krzysztof.czurylo@intel.com>
Date:   Fri Mar 17 15:50:53 2017 +0100

    test: limit number of arenas in vmem_stats
    
    By default, jemalloc allocates 4 * num_of_cpu arenas. If statistics
    are enabled, it also allocates the corresponding per-arena stat
    structures for all the arenas, even if only one arena is actually used
    (single-threaded program).  If this test is run on a machine with
    the number of cores >=64, the amount of memory required to keep all
    the statistics is larger than the usable space of the pool.
    
    The easiest workaround is to limit the number of arenas for this test
    by setting JE_VMEM_MALLOC_CONF environment variable.  Thus, the test can
    be run on any machine and we don't need to calculate the pool size
    based on number of available CPU cores.
    
    Backported from master (ccbf4cb).

diff --git a/src/test/vmem_stats/TEST0 b/src/test/vmem_stats/TEST0
index 5e11b9a..6f180b6 100755
--- a/src/test/vmem_stats/TEST0
+++ b/src/test/vmem_stats/TEST0
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# Copyright 2014-2016, Intel Corporation
+# Copyright 2014-2017, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
 
 setup
 
+# limit the number of arenas to fit into the minimal VMEM pool size
+export JE_VMEM_MALLOC_CONF="narenas:64"
+
 expect_normal_exit ./vmem_stats$EXESUFFIX 0
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
 
diff --git a/src/test/vmem_stats/TEST1 b/src/test/vmem_stats/TEST1
index bfabb87..1deb947 100755
--- a/src/test/vmem_stats/TEST1
+++ b/src/test/vmem_stats/TEST1
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# Copyright 2014-2016, Intel Corporation
+# Copyright 2014-2017, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
 
 setup
 
+# limit the number of arenas to fit into the minimal VMEM pool size
+export JE_VMEM_MALLOC_CONF="narenas:64"
+
 expect_normal_exit ./vmem_stats$EXESUFFIX 0 g
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
 
diff --git a/src/test/vmem_stats/TEST2 b/src/test/vmem_stats/TEST2
index 776e938..729a315 100755
--- a/src/test/vmem_stats/TEST2
+++ b/src/test/vmem_stats/TEST2
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# Copyright 2014-2016, Intel Corporation
+# Copyright 2014-2017, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
 
 setup
 
+# limit the number of arenas to fit into the minimal VMEM pool size
+export JE_VMEM_MALLOC_CONF="narenas:64"
+
 expect_normal_exit ./vmem_stats$EXESUFFIX 0 gbl
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
 
diff --git a/src/test/vmem_stats/TEST3 b/src/test/vmem_stats/TEST3
index 3bfb975..99ac9f4 100755
--- a/src/test/vmem_stats/TEST3
+++ b/src/test/vmem_stats/TEST3
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# Copyright 2014-2016, Intel Corporation
+# Copyright 2014-2017, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
 
 setup
 
+# limit the number of arenas to fit into the minimal VMEM pool size
+export JE_VMEM_MALLOC_CONF="narenas:64"
+
 expect_normal_exit ./vmem_stats$EXESUFFIX 0 gbla
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
 
diff --git a/src/test/vmem_stats/TEST4 b/src/test/vmem_stats/TEST4
index b310590..779fe86 100755
--- a/src/test/vmem_stats/TEST4
+++ b/src/test/vmem_stats/TEST4
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# Copyright 2014-2016, Intel Corporation
+# Copyright 2014-2017, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
 
 setup
 
+# limit the number of arenas to fit into the minimal VMEM pool size
+export JE_VMEM_MALLOC_CONF="narenas:64"
+
 expect_normal_exit ./vmem_stats$EXESUFFIX 0 gblma
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
 
diff --git a/src/test/vmem_stats/TEST5 b/src/test/vmem_stats/TEST5
index 5524b69..8d39f1a 100755
--- a/src/test/vmem_stats/TEST5
+++ b/src/test/vmem_stats/TEST5
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# Copyright 2014-2016, Intel Corporation
+# Copyright 2014-2017, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
 
 setup
 
+# limit the number of arenas to fit into the minimal VMEM pool size
+export JE_VMEM_MALLOC_CONF="narenas:64"
+
 expect_normal_exit ./vmem_stats$EXESUFFIX 1
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
 
diff --git a/src/test/vmem_stats/TEST6 b/src/test/vmem_stats/TEST6
index 6a6b8c7..3fc0a3a 100755
--- a/src/test/vmem_stats/TEST6
+++ b/src/test/vmem_stats/TEST6
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# Copyright 2014-2016, Intel Corporation
+# Copyright 2014-2017, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
 
 setup
 
+# limit the number of arenas to fit into the minimal VMEM pool size
+export JE_VMEM_MALLOC_CONF="narenas:64"
+
 expect_normal_exit ./vmem_stats$EXESUFFIX 1 g
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
 
diff --git a/src/test/vmem_stats/TEST7 b/src/test/vmem_stats/TEST7
index f9f1545..c7d4d5c 100755
--- a/src/test/vmem_stats/TEST7
+++ b/src/test/vmem_stats/TEST7
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# Copyright 2014-2016, Intel Corporation
+# Copyright 2014-2017, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
 
 setup
 
+# limit the number of arenas to fit into the minimal VMEM pool size
+export JE_VMEM_MALLOC_CONF="narenas:64"
+
 expect_normal_exit ./vmem_stats$EXESUFFIX 1 gbl
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
 
diff --git a/src/test/vmem_stats/TEST8 b/src/test/vmem_stats/TEST8
index 07c0e08..33509cc 100755
--- a/src/test/vmem_stats/TEST8
+++ b/src/test/vmem_stats/TEST8
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# Copyright 2014-2016, Intel Corporation
+# Copyright 2014-2017, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
 
 setup
 
+# limit the number of arenas to fit into the minimal VMEM pool size
+export JE_VMEM_MALLOC_CONF="narenas:64"
+
 expect_normal_exit ./vmem_stats$EXESUFFIX 1 gbla
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log
 
diff --git a/src/test/vmem_stats/TEST9 b/src/test/vmem_stats/TEST9
index b67f261..085835e 100755
--- a/src/test/vmem_stats/TEST9
+++ b/src/test/vmem_stats/TEST9
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# Copyright 2014-2016, Intel Corporation
+# Copyright 2014-2017, Intel Corporation
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -50,6 +50,9 @@ configure_valgrind memcheck force-disable
 
 setup
 
+# limit the number of arenas to fit into the minimal VMEM pool size
+export JE_VMEM_MALLOC_CONF="narenas:64"
+
 expect_normal_exit ./vmem_stats$EXESUFFIX 1 gblma
 grep -v '<libvmem>:'  vmem$UNITTEST_NUM.log > grep$UNITTEST_NUM.log