]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
run-make-check.sh: increase fs.aio-max-nr
authorKefu Chai <kchai@redhat.com>
Fri, 19 Mar 2021 08:18:23 +0000 (16:18 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 19 Mar 2021 08:24:33 +0000 (16:24 +0800)
without this change the seastar based tests fail on host with 48 cores,
because the /proc/sys/fs/aio-nr used by the tests is greater than
1048576. if run-make-check.sh is used to launch the test, the default
job number is `$(nproc) / 2`, and the peak number of /proc/sys/fs/aio-nr
when running ctest was 3190848 when testing on the 48-core host.

so we need to increase fs.aio-max-nr accordingly to the available cores
on the host.

Signed-off-by: Kefu Chai <kchai@redhat.com>
run-make-check.sh

index 3a7451c54e7f063c69a972e247a4c57e714d5193..12c16f2bca9295ec40f8eb9ca49100c6f562b922 100755 (executable)
@@ -32,7 +32,11 @@ function run() {
 
     # increase the aio-max-nr, which is by default 65536. we could reach this
     # limit while running seastar tests and bluestore tests.
-    $DRY_RUN sudo /sbin/sysctl -q -w fs.aio-max-nr=$((65536 * 16))
+    local m=16
+    if [ $(nproc) -gt $m ]; then
+        m=$(nproc)
+    fi
+    $DRY_RUN sudo /sbin/sysctl -q -w fs.aio-max-nr=$((65536 * $(nproc)))
 
     CHECK_MAKEOPTS=${CHECK_MAKEOPTS:-$DEFAULT_MAKEOPTS}
     if ! $DRY_RUN ctest $CHECK_MAKEOPTS --output-on-failure; then