mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-09 13:26:48 +00:00
Make the benchmark comparison with Linux on ext2 fairer
This commit is contained in:
parent
42e28763c5
commit
cfd23336e5
@ -44,6 +44,13 @@ prepare_libs() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Prepare fs for Linux
|
||||||
|
prepare_fs() {
|
||||||
|
# Disable unsupported ext2 features of Asterinas on Linux to ensure fairness
|
||||||
|
mke2fs -F -O ^ext_attr -O ^resize_inode -O ^dir_index ${BENCHMARK_DIR}/../build/ext2.img
|
||||||
|
make initramfs
|
||||||
|
}
|
||||||
|
|
||||||
# Parse the results from the benchmark output
|
# Parse the results from the benchmark output
|
||||||
parse_results() {
|
parse_results() {
|
||||||
local benchmark="$1"
|
local benchmark="$1"
|
||||||
@ -86,6 +93,10 @@ run_benchmark() {
|
|||||||
prepare_libs
|
prepare_libs
|
||||||
|
|
||||||
local asterinas_cmd="make run BENCHMARK=${benchmark} ENABLE_KVM=1 RELEASE_LTO=1 2>&1 | tee ${aster_output}"
|
local asterinas_cmd="make run BENCHMARK=${benchmark} ENABLE_KVM=1 RELEASE_LTO=1 2>&1 | tee ${aster_output}"
|
||||||
|
echo "Running benchmark ${benchmark} on Asterinas..."
|
||||||
|
eval "$asterinas_cmd"
|
||||||
|
|
||||||
|
prepare_fs
|
||||||
local linux_cmd="/usr/local/qemu/bin/qemu-system-x86_64 \
|
local linux_cmd="/usr/local/qemu/bin/qemu-system-x86_64 \
|
||||||
--no-reboot \
|
--no-reboot \
|
||||||
-smp 1 \
|
-smp 1 \
|
||||||
@ -100,9 +111,6 @@ run_benchmark() {
|
|||||||
-append 'console=ttyS0 rdinit=/benchmark/common/bench_runner.sh ${benchmark} linux mitigations=off hugepages=0 transparent_hugepage=never' \
|
-append 'console=ttyS0 rdinit=/benchmark/common/bench_runner.sh ${benchmark} linux mitigations=off hugepages=0 transparent_hugepage=never' \
|
||||||
-nographic \
|
-nographic \
|
||||||
2>&1 | tee ${linux_output}"
|
2>&1 | tee ${linux_output}"
|
||||||
|
|
||||||
echo "Running benchmark ${benchmark} on Asterinas..."
|
|
||||||
eval "$asterinas_cmd"
|
|
||||||
echo "Running benchmark ${benchmark} on Linux..."
|
echo "Running benchmark ${benchmark} on Linux..."
|
||||||
eval "$linux_cmd"
|
eval "$linux_cmd"
|
||||||
|
|
||||||
|
@ -45,7 +45,6 @@ prepare_system() {
|
|||||||
mount -t devtmpfs devtmpfs /dev
|
mount -t devtmpfs devtmpfs /dev
|
||||||
ip link set lo up
|
ip link set lo up
|
||||||
modprobe virtio_blk
|
modprobe virtio_blk
|
||||||
mkfs.ext2 -F /dev/vda
|
|
||||||
mount -t ext2 /dev/vda /ext2
|
mount -t ext2 /dev/vda /ext2
|
||||||
elif [ "$SYSTEM" = "asterinas" ]; then
|
elif [ "$SYSTEM" = "asterinas" ]; then
|
||||||
# Asterinas-specific preparation (if any)
|
# Asterinas-specific preparation (if any)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user