aboutsummaryrefslogtreecommitdiff
path: root/tests/run_tests.py
diff options
context:
space:
mode:
authorAndrew Hastings <abh@cray.com>2011-02-02 11:57:22 -0600
committerEric B Munson <emunson@mgebm.net>2011-02-23 14:29:07 -0500
commit8b55918e470927522a2e30e938c791bf4bbfa8df (patch)
tree26adf20582db4ea27021389544780a02b6d99538 /tests/run_tests.py
parent319122ba1f31cf5804901ec078dab5491f9202be (diff)
downloadlibhugetlbfs-8b55918e470927522a2e30e938c791bf4bbfa8df.tar.gz
Allow actions to be restricted to certain programs
By default, libhugetlbfs will act on any program that it is loaded with, either via LD_PRELOAD or by explicitly linking with -lhugetlbfs. There are situations in which it is desirable to restrict libhugetlbfs' actions to specific programs. For example, some ISV applications are wrapped in a series of scripts that invoke bash, python, and/or perl. It is more convenient to set the environment variables related to libhugetlbfs outside of the wrapper scripts, yet this has the unintended and undesirable consequence of causing the script interpreters to use and consume hugepages. Often there is no obvious benefit to causing the script interpreters to use hugepages, and there is a clear disadvantage: fewer hugepages are available to the actual application. To address this scenario, add a HUGETLB_RESTRICT_EXE environment variable. If this variable is set, libhugetlbfs will restrict its actions to only those programs named in HUGETLB_RESTRICT_EXE. (If not set, libhugetlbfs will attempt to apply the requested actions to all programs.) For example, HUGETLB_RESTRICT_EXE="hpcc:long_hpcc" will restrict libhugetlbfs' actions to programs named /home/fred/hpcc and /bench/long_hpcc but will not affect /usr/bin/hpcc_no. Based on a patch originally authored by Dean Luick <luick@cray.com>. Signed-off-by: Andrew Hastings <abh@cray.com> on behalf of Cray Inc. Signed-off-by: Eric B Munson <emunson@mgebm.net>
Diffstat (limited to 'tests/run_tests.py')
-rwxr-xr-xtests/run_tests.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/run_tests.py b/tests/run_tests.py
index 27a94cb..8055940 100755
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -554,6 +554,10 @@ def functional_tests():
do_test("direct")
do_test("malloc")
do_test("malloc", LD_PRELOAD="libhugetlbfs.so", HUGETLB_MORECORE="yes")
+ do_test("malloc", LD_PRELOAD="libhugetlbfs.so", HUGETLB_MORECORE="yes",
+ HUGETLB_RESTRICT_EXE="unknown:none")
+ do_test("malloc", LD_PRELOAD="libhugetlbfs.so", HUGETLB_MORECORE="yes",
+ HUGETLB_RESTRICT_EXE="unknown:malloc")
do_test("malloc_manysmall")
do_test("malloc_manysmall", LD_PRELOAD="libhugetlbfs.so",
HUGETLB_MORECORE="yes")