fstests: don't oom the box opening tmpfiles

For the t_open_tmpfiles tests, limit ourselves to half of file-max
so that we don't OOM the test machine.

[Eryu: fix comments too to match the new limit]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Darrick J. Wong
2019-02-25 18:35:29 -08:00
committed by Eryu Guan
parent 77df6c6ccf
commit dd2c726684
4 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -39,10 +39,10 @@ rm -f $seqres.full
_scratch_mkfs >> $seqres.full 2>&1
_scratch_mount
# Set ULIMIT_NOFILE to min(file-max, 50000 files per LOAD_FACTOR)
# Set ULIMIT_NOFILE to min(file-max / 2, 50000 files per LOAD_FACTOR)
# so that this test doesn't take forever or OOM the box
max_files=$((50000 * LOAD_FACTOR))
max_allowable_files=$(( $(cat /proc/sys/fs/file-max) ))
max_allowable_files=$(( $(cat /proc/sys/fs/file-max) / 2 ))
test $max_allowable_files -gt 0 && test $max_files -gt $max_allowable_files && \
max_files=$max_allowable_files
ulimit -n $max_files
+2 -2
View File
@@ -41,10 +41,10 @@ _scratch_mount
# Try to load up all the CPUs, two threads per CPU.
nr_cpus=$(( $(getconf _NPROCESSORS_ONLN) * 2 ))
# Set ULIMIT_NOFILE to min(file-max, 50000 files per LOAD_FACTOR)
# Set ULIMIT_NOFILE to min(file-max / 2, 50000 files per LOAD_FACTOR)
# so that this test doesn't take forever or OOM the box
max_files=$((50000 * LOAD_FACTOR))
max_allowable_files=$(( $(cat /proc/sys/fs/file-max) ))
max_allowable_files=$(( $(cat /proc/sys/fs/file-max) / 2 ))
test $max_allowable_files -gt 0 && test $max_files -gt $max_allowable_files && \
max_files=$max_allowable_files
ulimit -n $max_files
+2 -2
View File
@@ -44,10 +44,10 @@ rm -f $seqres.full
_scratch_mkfs >> $seqres.full 2>&1
_scratch_mount
# Set ULIMIT_NOFILE to min(file-max, 30000 files per LOAD_FACTOR)
# Set ULIMIT_NOFILE to min(file-max / 2, 30000 files per LOAD_FACTOR)
# so that this test doesn't take forever or OOM the box
max_files=$((30000 * LOAD_FACTOR))
max_allowable_files=$(( $(cat /proc/sys/fs/file-max) ))
max_allowable_files=$(( $(cat /proc/sys/fs/file-max) / 2 ))
test $max_allowable_files -gt 0 && test $max_files -gt $max_allowable_files && \
max_files=$max_allowable_files
ulimit -n $max_files
+2 -2
View File
@@ -43,10 +43,10 @@ _scratch_mount
# Load up all the CPUs, two threads per CPU.
nr_cpus=$(( $(getconf _NPROCESSORS_ONLN) * 2 ))
# Set ULIMIT_NOFILE to min(file-max, 30000 files per cpu per LOAD_FACTOR)
# Set ULIMIT_NOFILE to min(file-max / 2, 30000 files per cpu per LOAD_FACTOR)
# so that this test doesn't take forever or OOM the box
max_files=$((30000 * LOAD_FACTOR))
max_allowable_files=$(( $(cat /proc/sys/fs/file-max) ))
max_allowable_files=$(( $(cat /proc/sys/fs/file-max) / 2 ))
test $max_allowable_files -gt 0 && test $max_files -gt $max_allowable_files && \
max_files=$max_allowable_files
ulimit -n $max_files