Skip to content

Commit 026314e

Browse files
committed
optimize ext4 mount options that can be toggled at runtime.
1 parent 2aaa62b commit 026314e

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ jobs:
117117
with:
118118
fetch-depth: 2
119119

120+
- name: remount root filesystem
121+
run: src/ci/scripts/tune-rootfs.sh
122+
120123
# Free up disk space on Linux by removing preinstalled components that
121124
# we do not need. We do this to enable some of the less resource
122125
# intensive jobs to run on free runners, which however also have

src/ci/scripts/tune-rootfs.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
IFS=$'\n\t'
5+
6+
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
7+
8+
if isLinux && [[ $(findmnt -n /) =~ "ext4" ]] ; then
9+
# noauto_da_alloc since auto_da_alloc causes sync IO for some common file creation patterns
10+
# lazytime avoids sync IO when (rel)atime updates are applied
11+
# barrier=0 disables write cache flushing, which can reduce latency at the cost of durability,
12+
# but CI machines are ephemeral, so we don't need to be crash-proof.
13+
#
14+
# Ideally we'd set additional options, but those would require
15+
# a reboot or unmounting the rootfs.
16+
sudo mount -oremount,delalloc,nodiscard,lazytime,barrier=0,noauto_da_alloc /
17+
sudo bash -c 'echo "write through" > /sys/block/sda/queue/write_cache'
18+
19+
mount
20+
fi

0 commit comments

Comments
 (0)