[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4] hw/nvme: Use ioeventfd to handle doorbell updates
From: |
Jinhao Fan |
Subject: |
Re: [PATCH v4] hw/nvme: Use ioeventfd to handle doorbell updates |
Date: |
Wed, 6 Jul 2022 18:57:04 +0800 |
at 1:11 AM, Klaus Jensen <its@irrelevant.dk> wrote:
> On Jul 5 22:24, Jinhao Fan wrote:
>> Add property "ioeventfd" which is enabled by default. When this is
>> enabled, updates on the doorbell registers will cause KVM to signal
>> an event to the QEMU main loop to handle the doorbell updates.
>> Therefore, instead of letting the vcpu thread run both guest VM and
>> IO emulation, we now use the main loop thread to do IO emulation and
>> thus the vcpu thread has more cycles for the guest VM.
>
> This is not entirely accurate.
>
> Yes, the ioeventfd causes the doorbell write to be handled by the main
> iothread, but previously we did not do any substantial device emulation
> in the vcpu thread either. That is the reason why we only handle the
> bare minimum of the doorbell write and then defer any work until the
> timer fires on the main iothread.
>
> But with this patch we just go ahead and do the work (nvme_process_sq)
> immediately since we are already in the main iothread.
>
Thanks for pointing this out. I previously thought the timers are fired in
the vcpu threads. I misunderstood why this optimization works but
accidentally got the code right.
Re: [PATCH v4] hw/nvme: Use ioeventfd to handle doorbell updates, Jinhao Fan, 2022/07/08
Re: [PATCH v4] hw/nvme: Use ioeventfd to handle doorbell updates, Klaus Jensen, 2022/07/25
- Re: [PATCH v4] hw/nvme: Use ioeventfd to handle doorbell updates, Jinhao Fan, 2022/07/26
- Re: [PATCH v4] hw/nvme: Use ioeventfd to handle doorbell updates, Klaus Jensen, 2022/07/26
- Re: [PATCH v4] hw/nvme: Use ioeventfd to handle doorbell updates, Jinhao Fan, 2022/07/26
- Re: [PATCH v4] hw/nvme: Use ioeventfd to handle doorbell updates, Klaus Jensen, 2022/07/26
- Re: [PATCH v4] hw/nvme: Use ioeventfd to handle doorbell updates, Klaus Jensen, 2022/07/26
- Re: [PATCH v4] hw/nvme: Use ioeventfd to handle doorbell updates, Klaus Jensen, 2022/07/26