mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-13 23:36:48 +00:00
Make the benchmarks on ext2 more fair
This commit is contained in:
parent
6fcad6ce14
commit
8b1c69987f
@ -19,7 +19,6 @@ MODULES_DIR="${BENCHMARK_DIR}/../build/initramfs/lib/modules/${KERNEL_VERSION}/k
|
|||||||
WGET_SCRIPT="${BENCHMARK_DIR}/../../tools/atomic_wget.sh"
|
WGET_SCRIPT="${BENCHMARK_DIR}/../../tools/atomic_wget.sh"
|
||||||
|
|
||||||
# Generate entrypoint script for Linux cases
|
# Generate entrypoint script for Linux cases
|
||||||
# TODO: Disable optimize-related features in Linux's ext2 using 'mkfs.ext2 -O ^[feature]'
|
|
||||||
generate_entrypoint_script() {
|
generate_entrypoint_script() {
|
||||||
local benchmark="$1"
|
local benchmark="$1"
|
||||||
local init_script=$(cat <<EOF
|
local init_script=$(cat <<EOF
|
||||||
@ -27,7 +26,6 @@ generate_entrypoint_script() {
|
|||||||
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
|
||||||
|
|
||||||
echo "Running ${benchmark}"
|
echo "Running ${benchmark}"
|
||||||
@ -56,7 +54,6 @@ run_benchmark() {
|
|||||||
generate_entrypoint_script "${benchmark}" > "${initramfs_entrypoint_script}"
|
generate_entrypoint_script "${benchmark}" > "${initramfs_entrypoint_script}"
|
||||||
chmod +x "${initramfs_entrypoint_script}"
|
chmod +x "${initramfs_entrypoint_script}"
|
||||||
|
|
||||||
# TODO: enable nopti for Linux to make the comparison more fair
|
|
||||||
local qemu_cmd="/usr/local/qemu/bin/qemu-system-x86_64 \
|
local qemu_cmd="/usr/local/qemu/bin/qemu-system-x86_64 \
|
||||||
--no-reboot \
|
--no-reboot \
|
||||||
-smp 1 \
|
-smp 1 \
|
||||||
@ -83,8 +80,13 @@ run_benchmark() {
|
|||||||
${WGET_SCRIPT} "${MODULES_DIR}/drivers/block/virtio_blk.ko" "https://raw.githubusercontent.com/asterinas/linux_kernel/f938bde/modules/virtio_blk.ko"
|
${WGET_SCRIPT} "${MODULES_DIR}/drivers/block/virtio_blk.ko" "https://raw.githubusercontent.com/asterinas/linux_kernel/f938bde/modules/virtio_blk.ko"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Running benchmark ${benchmark} on Linux and Asterinas..."
|
echo "Running benchmark ${benchmark} on Asterinas..."
|
||||||
make run BENCHMARK=${benchmark} ENABLE_KVM=1 RELEASE_LTO=1 2>&1 | tee "${aster_output}"
|
make run BENCHMARK=${benchmark} ENABLE_KVM=1 RELEASE_LTO=1 2>&1 | tee "${aster_output}"
|
||||||
|
|
||||||
|
echo "Running benchmark ${benchmark} on Linux..."
|
||||||
|
# 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
|
||||||
eval "$qemu_cmd"
|
eval "$qemu_cmd"
|
||||||
|
|
||||||
echo "Parsing results..."
|
echo "Parsing results..."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user