From: Asias He <asias.hejun@gmail.com>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>,
"Michael S. Tsirkin" <mst@redhat.com>,
Rusty Russell <rusty@rustcorp.com.au>,
Mark McLoughlin <markmc@redhat.com>,
Anthony Liguori <aliguori@us.ibm.com>,
Pekka Enberg <penberg@kernel.org>,
Cyrill Gorcunov <gorcunov@gmail.com>,
Prasad Joshi <prasadjoshi124@gmail.com>,
kvm@vger.kernel.org
Subject: Re: [PATCH 1/2] kvm tools: Respect ISR status in virtio header
Date: Sat, 07 May 2011 18:39:25 +0800 [thread overview]
Message-ID: <4DC5215D.9020207@gmail.com> (raw)
In-Reply-To: <1304764440.10534.22.camel@lappy>
On 05/07/2011 06:34 PM, Sasha Levin wrote:
> On Sat, 2011-05-07 at 11:30 +0200, Ingo Molnar wrote:
>> * Asias He <asias.hejun@gmail.com> wrote:
>>
>>> Inject IRQ to guest only when ISR status is low which means
>>> guest has read ISR status and device has cleared this bit as
>>> the side effect of this reading.
>>>
>>> This reduces a lot of unnecessary IRQ inject from device to
>>> guest.
>>>
>>> Netpef test shows this patch changes:
>>>
>>> the host to guest bandwidth
>>> from 2866.27 Mbps (cpu 33.96%) to 5548.87 Mbps (cpu 53.87%),
>>>
>>> the guest to host bandwitdth
>>> form 1408.86 Mbps (cpu 99.9%) to 1301.29 Mbps (cpu 99.9%).
>>>
>>> The bottleneck of the guest to host bandwidth is guest cpu power.
>>>
>>> Signed-off-by: Asias He <asias.hejun@gmail.com>
>>> ---
>> Hm, the ISR flag seems to be an explicit IRQ-ack mechanism, not just an
>> optimization.
>>
>> Perhaps if the guest kernel side virtio driver expects us to do honor these
>> acks and not inject double irqs when the virtio driver does not expect them?
>>
>> There's this code in drivers/virtio/virtio_pci.c:
>>
>> /* reading the ISR has the effect of also clearing it so it's very
>> * important to save off the value. */
>> isr = ioread8(vp_dev->ioaddr + VIRTIO_PCI_ISR);
>>
>> Which seems to suggest that this ISR flag is more important than just a
>> performance hint.
>>
>> Pekka: was this the patch perhaps that fixed the ping latency problem for you?
>>
>> Could any virtio gents on Cc: please confirm/deny this theory? :-)
>>
>> The original problem was that the virtio-net driver in tools/kvm/virtio/net.c
>> was producing unexplained latencies (long ping latencies) under certain
>> circumstances. Sometimes it triggered spontaneously, sometimes it needed a ping
>> -f flood to trigger. The root cause of that race is still not understood.
>
> Looks like it solved the ping -f issue here.
>
> Why was this change only implemented in virtio-net? shouldn't it go to
> the other virtio drivers as well?
I will send follow up patchs to virtio-* ;-)
--
Best Regards,
Asias He
next prev parent reply other threads:[~2011-05-07 10:40 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-07 2:34 [PATCH 1/2] kvm tools: Respect ISR status in virtio header Asias He
2011-05-07 2:34 ` [PATCH 2/2] kvm tools: Respect VRING_AVAIL_F_NO_INTERRUPT Asias He
2011-05-07 7:55 ` Ingo Molnar
2011-05-07 9:03 ` Pekka Enberg
2011-05-07 11:25 ` Asias He
2011-05-07 9:30 ` [PATCH 1/2] kvm tools: Respect ISR status in virtio header Ingo Molnar
2011-05-07 10:34 ` Sasha Levin
2011-05-07 10:39 ` Pekka Enberg
2011-05-07 10:39 ` Asias He [this message]
2011-05-07 11:15 ` Asias He
2011-05-07 14:00 ` Ingo Molnar
2011-05-07 14:24 ` Asias He
2011-05-07 13:14 ` Anthony Liguori
2011-05-07 14:02 ` Ingo Molnar
2011-05-07 14:21 ` Anthony Liguori
2011-05-07 14:47 ` Ingo Molnar
2011-05-07 14:52 ` Pekka Enberg
2011-05-07 14:55 ` Ingo Molnar
2011-05-07 14:50 ` Pekka Enberg
2011-05-07 15:01 ` Anthony Liguori
2011-05-07 15:02 ` Pekka Enberg
2011-05-07 15:06 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DC5215D.9020207@gmail.com \
--to=asias.hejun@gmail.com \
--cc=aliguori@us.ibm.com \
--cc=gorcunov@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=levinsasha928@gmail.com \
--cc=markmc@redhat.com \
--cc=mingo@elte.hu \
--cc=mst@redhat.com \
--cc=penberg@kernel.org \
--cc=prasadjoshi124@gmail.com \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox