qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] multiboot: Use DMA instead port-based transfer


From: Stefano Garzarella
Subject: Re: [PATCH] multiboot: Use DMA instead port-based transfer
Date: Tue, 19 Oct 2021 10:28:09 +0200

CCing Paolo since kvm-unit-tests use multiboot.

On Sun, Oct 10, 2021 at 09:10:05PM +0200, Adam Lackorzynski wrote:
Use DMA transfers in the multiboot loader to copy
data.

This significantly lowers QEMU's startup latency by
a factor of about 40, for example, going from 30sec
to 0.8sec when loading modules of 120MB in size.
This change has been used successfully for some time.

Signed-off-by: Marcus Hähnel <marcus.haehnel@kernkonzept.com>
Signed-off-by: Adam Lackorzynski <adam@l4re.org>
---
pc-bios/multiboot.bin         | Bin 1024 -> 1536 bytes
pc-bios/optionrom/multiboot.S |  10 ++---
pc-bios/optionrom/optionrom.h |  77 ++++++++++++++++++++++++++++++++++
3 files changed, 82 insertions(+), 5 deletions(-)

I tested with https://gitlab.com/kvm-unit-tests/kvm-unit-tests running:
 export QEMU=`/path/to/qemu-system-x86_64 -L path/to/pc-bios/optionrom`
 time ./run_test.sh

Before this patch:
real    3m5.578s
user    2m32.231s
sys     0m50.390s

After this patch:
real    2m55.614s
user    2m20.536s
sys     0m50.046s

It's still a good improvement, considering the fact that the images aren't big.

Just a consideration, for blobs (kernel and initrd) I fully agree to use DMA, but for 32bit variables is it useful?

However, this patch LGTM:

Tested-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]