Skip to content

Commit 482b4b7

Browse files
committed
testenv: Set ulimit to unlimited instead of a fixed number
Raising the ulimit to a fixed value doesn't work reliably: When we're only loading a single program it works fine, but the limit is global for the system, so if something else (e.g., another map or program) is already loaded, the ulimit requirement is higher. Rather than trying to guess, just set the memlock ulimit to unlimited. Fixes #86. Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
1 parent 77340a1 commit 482b4b7

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

testenv/testenv.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ source "$(dirname "$0")/config.sh"
1616

1717
NEEDED_TOOLS="ethtool ip tc ping"
1818
MAX_NAMELEN=15
19-
MIN_ULIMIT_L=4096
2019

2120
# Global state variables that will be set by options etc below
2221
GENERATE_NEW=0
@@ -67,9 +66,7 @@ check_prereq()
6766
[ -d "$STATEDIR" ] || mkdir -p "$STATEDIR" || die "Unable to create state dir $STATEDIR"
6867

6968
if [ "$max_locked_mem" != "unlimited" ]; then
70-
if [ "$max_locked_mem" -ge "$MIN_ULIMIT_L" ]; then
71-
ulimit -l "$MIN_ULIMIT_L" || die "Unable to set ulimit"
72-
fi
69+
ulimit -l unlimited || die "Unable to set ulimit"
7370
fi
7471
}
7572

0 commit comments

Comments
 (0)