Skip to contentSkip to conversation

Don't arm tx hrtimer with a constant 500us each transmit

PATCH In review Dor Laor 8 participants 24 messages Dec 12, 2007 – Dec 19, 2007 9 messages not in the archive

Subsystems (5)
lore
Share & tools
lore

Dor Laor

author
#0 lore raw

PATCH 1/1 Don't arm tx hrtimer with a constant 500us each transmit

commit 763769621d271d92204ed27552d75448587c1ac0

Author: Dor Laor <[email protected]>
Date:   Wed Dec 12 14:52:00 2007 +0200

[virtio-net][PATCH] Don't arm tx hrtimer with a constant 50us each
transmit

The current start_xmit sets 500us hrtimer to kick the host. The problem is that if another xmit happens before the timer was
fired then
the first xmit will have to wait additional 500us. This patch does not re-arm the timer if there is existing one. This will shorten the latency for tx.

drivers/net/virtio_net.c +0 -0
index 7b051d5..8bb17d1
@@ -406,10 +405,10 @@ again:
        virtio_debug(vdebug, "%s: before calling kick %d\n", 
__FUNCTION__, __LINE__);
        vi->svq->vq_ops->kick(vi->svq);
        vi->out_num = 0;

- } else {
- vi->stats.hrtimer_starts++;
- hrtimer_start(&vi->tx_timer, ktime_set(0,500000),
- HRTIMER_MODE_REL);
+ } else if (!hrtimer_is_queued(&vi->tx_timer)) {
+ vi->stats.hrtimer_starts++;
+ hrtimer_start(&vi->tx_timer, ktime_set(0,500000),

+                      HRTIMER_MODE_REL);
    }
    return 0;
}
#1 lore raw

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

drivers/net/virtio_net.c again:

Quoted 3 lines
drivers/net/virtio_net.c +0 -0
@@ -406,10 +405,10 @@ again:

Hmm, while I agree in general with the patch, I fail to find the proper version of virtio_net where this patch applies. I tried kvm.git and linux-2.6.git from kernel.org. Can you give me a pointer to the repository where you work on virtio?

Christian

author
#2 lore raw
Quoted 11 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

drivers/net/virtio_net.c again:

Quoted 3 lines
drivers/net/virtio_net.c +0 -0
@@ -406,10 +405,10 @@ again:

Hmm, while I agree in general with the patch, I fail to find the proper version of virtio_net where this patch applies. I tried kvm.git and linux-2.6.git from kernel.org. Can you give me a pointer to the repository where you work on virtio?

Sorry for that, I added some debug prints of my one.
Here it is: *git clone git*://kvm.*qumranet*.com/home/*dor*/src/linux-2.6-nv use branch 'virtio'.
BTW: what git repository do you use?

This patch improves my tx performance from 720Mbps to 900Mbps. Dor

Quoted 3 lines

Christian

#3 lore raw

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

Quoted 10 lines
Quoted 9 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

drivers/net/virtio_net.c again:

Quoted 3 lines
drivers/net/virtio_net.c +0 -0
@@ -406,10 +405,10 @@ again:

Hmm, while I agree in general with the patch, I fail to find the proper version of virtio_net where this patch applies. I tried kvm.git and linux-2.6.git from kernel.org. Can you give me a pointer to the

repository

Quoted 5 lines
Quoted 2 lines

where you work on virtio?

Sorry for that, I added some debug prints of my one.
Here it is: *git clone git*://kvm.*qumranet*.com/home/*dor*/src/linux-2.6-nv use branch 'virtio'.

Ah, ok. I will look into that branch.

Quoted 1 line

BTW: what git repository do you use?

I use Avis git from kernel.org:
git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm

Christian

A message that is not in the archive (sent off-list or not yet received): 200712121733.07804.borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org

#5 lore raw
Quoted 19 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

Quoted 8 lines
Quoted 7 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

drivers/net/virtio_net.c again:

Quoted 3 lines
drivers/net/virtio_net.c +0 -0
@@ -406,10 +405,10 @@ again:

Hmm, while I agree in general with the patch, I fail to find the

proper

Quoted 2 lines
Quoted 2 lines

version of virtio_net where this patch applies. I tried kvm.git and linux-2.6.git from kernel.org. Can you give me a pointer to the

repository

Quoted 5 lines
Quoted 2 lines

where you work on virtio?

Sorry for that, I added some debug prints of my one. Here it is: *git clone git*://kvm.*qumranet*.com/home/*dor*/src/linux-2.6-nv use branch

Quoted 9 lines

'virtio'.

Ah, ok. I will look into that branch.

Quoted 1 line

BTW: what git repository do you use?

I use Avis git from kernel.org:
git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm

I patch it with Anthony's http://hg.codemonkey.ws/linux-virtio/
Over that I send the patches. One can use my repository directly.

Quoted 3 lines

Christian

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

A message that is not in the archive (sent off-list or not yet received): 4760F0EA.7010004-atKUWr5tajBWk0Htik3J/[email protected]

#7 lore raw
Quoted 11 lines · Dor Laor
Quoted 10 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

Quoted 6 lines
Quoted 5 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

drivers/net/virtio_net.c again:

Quoted 3 lines
drivers/net/virtio_net.c +0 -0
@@ -406,10 +405,10 @@ again:

Hmm, while I agree in general with the patch, I fail to find the

proper

Quoted 2 lines
Quoted 2 lines

version of virtio_net where this patch applies. I tried kvm.git and linux-2.6.git from kernel.org. Can you give me a pointer to the

Quoted 8 lines
Quoted 8 lines

repository

Quoted 5 lines
Quoted 2 lines

where you work on virtio?

Sorry for that, I added some debug prints of my one. Here it is: *git clone git*://kvm.*qumranet*.com/home/*dor*/src/linux-2.6-nv use branch

'virtio'.

Hi Dor,

Which userspace repo is usable with the above repo?

Thanks,
Cam

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw
Quoted 21 lines · Cam Macdonell
Quoted 11 lines · Dor Laor
Quoted 10 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

Quoted 6 lines
Quoted 5 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

drivers/net/virtio_net.c again:

Quoted 3 lines
drivers/net/virtio_net.c +0 -0
@@ -406,10 +405,10 @@ again:

Hmm, while I agree in general with the patch, I fail to find the

proper

Quoted 2 lines
Quoted 2 lines

version of virtio_net where this patch applies. I tried kvm.git and linux-2.6.git from kernel.org. Can you give me a pointer to the

Quoted 8 lines
Quoted 8 lines

repository

Quoted 5 lines
Quoted 2 lines

where you work on virtio?

Sorry for that, I added some debug prints of my one. Here it is: *git clone git*://kvm.*qumranet*.com/home/*dor*/src/linux-2.6-nv use branch

'virtio'.

Quoted 7 lines

Hi Dor,

Which userspace repo is usable with the above repo?

Thanks,
Cam

git://kvm.qumranet.com/home/dor/src/kvm-nv use branch Regards,
Dor.

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

A message that is not in the archive (sent off-list or not yet received): 4764FA5E.3070104-atKUWr5tajBWk0Htik3J/[email protected]

#11 lore raw
Quoted 22 lines · Dor Laor
Quoted 21 lines · Cam Macdonell
Quoted 19 lines · Dor Laor
Quoted 18 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

Quoted 6 lines
Quoted 5 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

drivers/net/virtio_net.c again:

Quoted 3 lines
drivers/net/virtio_net.c +0 -0
@@ -406,10 +405,10 @@ again:

Hmm, while I agree in general with the patch, I fail to find the

proper

Quoted 2 lines
Quoted 2 lines

version of virtio_net where this patch applies. I tried kvm.git and linux-2.6.git from kernel.org. Can you give me a pointer to the

repository

Quoted 5 lines
Quoted 2 lines

where you work on virtio?

Sorry for that, I added some debug prints of my one. Here it is: *git clone git*://kvm.*qumranet*.com/home/*dor*/src/linux-2.6-nv use branch

'virtio'.

Quoted 8 lines
Quoted 7 lines

Hi Dor,

Which userspace repo is usable with the above repo?

Thanks,
Cam

git://kvm.qumranet.com/home/dor/src/kvm-nv use branch

Hi Dor,

I think you forgot a word after branch above. Also, I get the following error when I try clone the userspace repo.

cam@madhatter:~/src/KVM$ git clone 
git://kvm.qumranet.com/home/dor/src/kvm-nv
Initialized empty Git repository in /home/cam/src/KVM/kvm-nv/.git/
fatal: The remote end hung up unexpectedly
fetch-pack from 'git://kvm.qumranet.com/home/dor/src/kvm-nv' failed.

Thanks,
Cam

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

A message that is not in the archive (sent off-list or not yet received): [email protected]

#13 lore raw
Quoted 38 lines · Cam Macdonell
Quoted 22 lines · Dor Laor
Quoted 21 lines · Cam Macdonell
Quoted 19 lines · Dor Laor
Quoted 18 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

Quoted 6 lines
Quoted 5 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

drivers/net/virtio_net.c again:

Quoted 3 lines
drivers/net/virtio_net.c +0 -0
@@ -406,10 +405,10 @@ again:

Hmm, while I agree in general with the patch, I fail to find the

proper

Quoted 2 lines
Quoted 2 lines

version of virtio_net where this patch applies. I tried kvm.git and linux-2.6.git from kernel.org. Can you give me a pointer to the

repository

Quoted 5 lines
Quoted 2 lines

where you work on virtio?

Sorry for that, I added some debug prints of my one. Here it is: *git clone git*://kvm.*qumranet*.com/home/*dor*/src/linux-2.6-nv use branch

'virtio'.

Quoted 8 lines
Quoted 7 lines

Hi Dor,

Which userspace repo is usable with the above repo?

Thanks,
Cam

git://kvm.qumranet.com/home/dor/src/kvm-nv use branch

Hi Dor,

I think you forgot a word after branch above. Also, I get the following error when I try clone the userspace repo.

Quoted 9 lines
cam@madhatter:~/src/KVM$ git clone
git://kvm.qumranet.com/home/dor/src/kvm-nv
Initialized empty Git repository in /home/cam/src/KVM/kvm-nv/.git/
fatal: The remote end hung up unexpectedly
fetch-pack from 'git://kvm.qumranet.com/home/dor/src/kvm-nv' failed.

Thanks,
Cam

Sorry here are the two repositories:

Kernel: git://people.qumranet.com/home/dor/src/linux-2.6-nv
User: git://people.qumranet.com/home/dor/src/kvm-nv
Please use 'virtio' branch for both repositories.

Thanks,
Dor.

BTW: I maid some performance improvements and I get 900Mbps for tx and 800Mbps for rx. I intend to send these changes to Avi to incorporate in mainline KVM.

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

#14 lore raw
In reply to a message not in the archive
Quoted 33 lines · Cam Macdonell
Quoted 21 lines · Dor Laor
Quoted 20 lines · Cam Macdonell
Quoted 19 lines · Dor Laor
Quoted 18 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

Quoted 6 lines
Quoted 5 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

drivers/net/virtio_net.c again:

Quoted 3 lines
drivers/net/virtio_net.c +0 -0
@@ -406,10 +405,10 @@ again:

Hmm, while I agree in general with the patch, I fail to find the

proper

Quoted 2 lines
Quoted 2 lines

version of virtio_net where this patch applies. I tried kvm.git and linux-2.6.git from kernel.org. Can you give me a pointer to the

repository

Quoted 5 lines
Quoted 2 lines

where you work on virtio?

Sorry for that, I added some debug prints of my one. Here it is: *git clone git*://kvm.*qumranet*.com/home/*dor*/src/linux-2.6-nv use branch

'virtio'.

Quoted 8 lines
Quoted 7 lines

Hi Dor,

Which userspace repo is usable with the above repo?

Thanks,
Cam

git://kvm.qumranet.com/home/dor/src/kvm-nv use branch

Hi Dor,

Quoted 9 lines

I think you forgot a word after branch above. Also, I get the following error when I try clone the userspace repo.

cam@madhatter:~/src/KVM$ git clone 
git://kvm.qumranet.com/home/dor/src/kvm-nv
Initialized empty Git repository in /home/cam/src/KVM/kvm-nv/.git/
fatal: The remote end hung up unexpectedly
fetch-pack from 'git://kvm.qumranet.com/home/dor/src/kvm-nv' failed.

Ok, it works now, however, I'm getting an unknown symbol error when loading kvm in to kernel

cam@madhatter:~/src/KVM/dor$ sudo modprobe kvm
FATAL: Error inserting kvm 
(/lib/modules/2.6.22-14-generic/extra/kvm.ko): Unknown symbol in module, 
or unknown parameter (see dmesg)

dmesg output:

[89681.960000] kvm: Unknown symbol __fls

Do you know what might be causing this?

Thanks,
Cam

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

A message that is not in the archive (sent off-list or not yet received): [email protected]

#16 lore raw
Quoted 46 lines · Cam Macdonell
Quoted 32 lines · Cam Macdonell
Quoted 21 lines · Dor Laor
Quoted 20 lines · Cam Macdonell
Quoted 19 lines · Dor Laor
Quoted 18 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

Quoted 6 lines
Quoted 5 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

drivers/net/virtio_net.c again:

Quoted 3 lines
drivers/net/virtio_net.c +0 -0
@@ -406,10 +405,10 @@ again:

Hmm, while I agree in general with the patch, I fail to find the

proper

Quoted 2 lines
Quoted 2 lines

version of virtio_net where this patch applies. I tried kvm.git and linux-2.6.git from kernel.org. Can you give me a pointer to the

repository

Quoted 5 lines
Quoted 2 lines

where you work on virtio?

Sorry for that, I added some debug prints of my one. Here it is: *git clone git*://kvm.*qumranet*.com/home/*dor*/src/linux-2.6-nv use branch

'virtio'.

Quoted 8 lines
Quoted 7 lines

Hi Dor,

Which userspace repo is usable with the above repo?

Thanks,
Cam

git://kvm.qumranet.com/home/dor/src/kvm-nv use branch

Hi Dor,

Quoted 9 lines

I think you forgot a word after branch above. Also, I get the following error when I try clone the userspace repo.

cam@madhatter:~/src/KVM$ git clone 
git://kvm.qumranet.com/home/dor/src/kvm-nv
Initialized empty Git repository in /home/cam/src/KVM/kvm-nv/.git/
fatal: The remote end hung up unexpectedly
fetch-pack from 'git://kvm.qumranet.com/home/dor/src/kvm-nv' failed.

Ok, it works now, however, I'm getting an unknown symbol error when loading kvm in to kernel

Quoted 8 lines
cam@madhatter:~/src/KVM/dor$ sudo modprobe kvm
FATAL: Error inserting kvm 
(/lib/modules/2.6.22-14-generic/extra/kvm.ko): Unknown symbol in module, 
or unknown parameter (see dmesg)

dmesg output:

[89681.960000] kvm: Unknown symbol __fls

Hi Dor,

It seems this is a 32 v 64-bit issue. I'm running a 32-bit system. The asm-x86/bitops_64.h defines __fls whereas asm-x86/bitops_32.h defines fls. Simply replacing __fls with fls allows the module to load into the kernel and I am able to boot VMs with it.

I hope that helps.

Cam

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

A message that is not in the archive (sent off-list or not yet received): [email protected]

#18 lore raw
Quoted 59 lines · Cam Macdonell
Quoted 47 lines · Cam Macdonell
Quoted 33 lines · Cam Macdonell
Quoted 22 lines · Dor Laor
Quoted 21 lines · Cam Macdonell
Quoted 20 lines · Dor Laor
Quoted 19 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

Quoted 6 lines
Quoted 5 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

drivers/net/virtio_net.c again:

Quoted 3 lines
drivers/net/virtio_net.c +0 -0
@@ -406,10 +405,10 @@ again:

Hmm, while I agree in general with the patch, I fail to find the

proper

Quoted 3 lines
Quoted 3 lines

version of virtio_net where this patch applies. I tried kvm.git and
linux-2.6.git from kernel.org. Can you give me a pointer to the

repository

Quoted 5 lines
Quoted 2 lines

where you work on virtio?

Sorry for that, I added some debug prints of my one. Here it is: *git clone git*://kvm.*qumranet*.com/home/*dor*/src/linux-2.6-nv use branch

'virtio'.

Quoted 8 lines
Quoted 7 lines

Hi Dor,

Which userspace repo is usable with the above repo?

Thanks,
Cam

git://kvm.qumranet.com/home/dor/src/kvm-nv use branch

Hi Dor,

Quoted 9 lines

I think you forgot a word after branch above. Also, I get the following error when I try clone the userspace repo.

cam@madhatter:~/src/KVM$ git clone 
git://kvm.qumranet.com/home/dor/src/kvm-nv
Initialized empty Git repository in /home/cam/src/KVM/kvm-nv/.git/
fatal: The remote end hung up unexpectedly
fetch-pack from 'git://kvm.qumranet.com/home/dor/src/kvm-nv' failed.

Ok, it works now, however, I'm getting an unknown symbol error when loading kvm in to kernel

Quoted 8 lines
cam@madhatter:~/src/KVM/dor$ sudo modprobe kvm
FATAL: Error inserting kvm 
(/lib/modules/2.6.22-14-generic/extra/kvm.ko): Unknown symbol in 
module, or unknown parameter (see dmesg)

dmesg output:

[89681.960000] kvm: Unknown symbol __fls

Hi Dor,

Quoted 9 lines

It seems this is a 32 v 64-bit issue. I'm running a 32-bit system. The asm-x86/bitops_64.h defines __fls whereas asm-x86/bitops_32.h defines fls. Simply replacing __fls with fls allows the module to load into the kernel and I am able to boot VMs with it.

I hope that helps.

Cam

Good, anyway the __fls is part of unneeded commit that I need to revert. Thanks, Dor

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

author
#19 lore raw
In reply to Christian Borntraeger
Quoted 19 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

Quoted 8 lines
Quoted 7 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

drivers/net/virtio_net.c again:

Quoted 3 lines
drivers/net/virtio_net.c +0 -0
@@ -406,10 +405,10 @@ again:

Hmm, while I agree in general with the patch, I fail to find the

proper

Quoted 2 lines
Quoted 2 lines

version of virtio_net where this patch applies. I tried kvm.git and linux-2.6.git from kernel.org. Can you give me a pointer to the

repository

Quoted 5 lines
Quoted 2 lines

where you work on virtio?

Sorry for that, I added some debug prints of my one. Here it is: *git clone git*://kvm.*qumranet*.com/home/*dor*/src/linux-2.6-nv use branch

Quoted 9 lines

'virtio'.

Ah, ok. I will look into that branch.

Quoted 1 line

BTW: what git repository do you use?

I use Avis git from kernel.org:
git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm

I patch it with Anthony's http://hg.codemonkey.ws/linux-virtio/
Over that I send the patches. One can use my repository directly.

Quoted 3 lines

Christian

#20 lore raw
In reply to Dor Laor

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

Quoted 10 lines
Quoted 9 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

drivers/net/virtio_net.c again:

Quoted 3 lines
drivers/net/virtio_net.c +0 -0
@@ -406,10 +405,10 @@ again:

Hmm, while I agree in general with the patch, I fail to find the proper version of virtio_net where this patch applies. I tried kvm.git and linux-2.6.git from kernel.org. Can you give me a pointer to the

repository

Quoted 5 lines
Quoted 2 lines

where you work on virtio?

Sorry for that, I added some debug prints of my one.
Here it is: *git clone git*://kvm.*qumranet*.com/home/*dor*/src/linux-2.6-nv use branch 'virtio'.

Ah, ok. I will look into that branch.

Quoted 1 line

BTW: what git repository do you use?

I use Avis git from kernel.org:
git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm

Christian

author
#21 lore raw
In reply to Christian Borntraeger
Quoted 11 lines · Christian Borntraeger

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

drivers/net/virtio_net.c again:

Quoted 3 lines
drivers/net/virtio_net.c +0 -0
@@ -406,10 +405,10 @@ again:

Hmm, while I agree in general with the patch, I fail to find the proper version of virtio_net where this patch applies. I tried kvm.git and linux-2.6.git from kernel.org. Can you give me a pointer to the repository where you work on virtio?

Sorry for that, I added some debug prints of my one.
Here it is: *git clone git*://kvm.*qumranet*.com/home/*dor*/src/linux-2.6-nv use branch 'virtio'.
BTW: what git repository do you use?

This patch improves my tx performance from 720Mbps to 900Mbps. Dor

Quoted 3 lines

Christian

#22 lore raw
In reply to Dor Laor

Am Mittwoch, 12. Dezember 2007 schrieb Dor Laor:

drivers/net/virtio_net.c again:

Quoted 3 lines
drivers/net/virtio_net.c +0 -0
@@ -406,10 +405,10 @@ again:

Hmm, while I agree in general with the patch, I fail to find the proper version of virtio_net where this patch applies. I tried kvm.git and linux-2.6.git from kernel.org. Can you give me a pointer to the repository where you work on virtio?

Christian

#23 lore raw
In reply to Dor Laor
Quoted 7 lines · On Wednesday 12 December 2007 23:54:00 Dor Laor wrote:

commit 763769621d271d92204ed27552d75448587c1ac0

Author: Dor Laor <[email protected]>
Date:   Wed Dec 12 14:52:00 2007 +0200

[virtio-net][PATCH] Don't arm tx hrtimer with a constant 50us each
transmit

Quoted 6 lines

The current start_xmit sets 500us hrtimer to kick the host. The problem is that if another xmit happens before the timer was
fired then
the first xmit will have to wait additional 500us. This patch does not re-arm the timer if there is existing one. This will shorten the latency for tx.

Hi Dor!

Yes, I pondered this when I wrote the code. On the one hand, it's a
low-probability pathological corner case, on the other, your patch reduces the number of timer reprograms in the normal case.

So I've applied it, thanks!
Rusty.

Quoted 23 lines
drivers/net/virtio_net.c +4 -4
index 7b051d5..8bb17d1
@@ -406,10 +405,10 @@ again:
         virtio_debug(vdebug, "%s: before calling kick %d\n",
 __FUNCTION__, __LINE__);
         vi->svq->vq_ops->kick(vi->svq);
         vi->out_num = 0;
-    } else {
-        vi->stats.hrtimer_starts++;
-        hrtimer_start(&vi->tx_timer, ktime_set(0,500000),
-                  HRTIMER_MODE_REL);
+    } else if (!hrtimer_is_queued(&vi->tx_timer)) {
+            vi->stats.hrtimer_starts++;
+            hrtimer_start(&vi->tx_timer, ktime_set(0,500000),
+                      HRTIMER_MODE_REL);
     }
     return 0;

}

A message that is not in the archive (sent off-list or not yet received): 200712181101.14916.rusty-8n+1lVoiYb80n/[email protected]

#25 lore raw
Quoted 17 lines · Rusty Russell
Quoted 7 lines · On Wednesday 12 December 2007 23:54:00 Dor Laor wrote:

commit 763769621d271d92204ed27552d75448587c1ac0

Author: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/[email protected]>
Date:   Wed Dec 12 14:52:00 2007 +0200

[virtio-net][PATCH] Don't arm tx hrtimer with a constant 50us each
transmit

Quoted 7 lines

The current start_xmit sets 500us hrtimer to kick the host. The problem is that if another xmit happens before the timer was
fired then
the first xmit will have to wait additional 500us. This patch does not re-arm the timer if there is existing one. This will shorten the latency for tx.

Quoted 6 lines

Hi Dor!

Yes, I pondered this when I wrote the code. On the one hand, it's a
low-probability pathological corner case, on the other, your patch reduces the number of timer reprograms in the normal case.

One thing that came up in our discussions is to let the host do the timer processing instead of the guest. When tx exit mitigation is enabled, the guest bumps the queue pointer, but carefully refrains from kicking the host. The host polls the tx pointer using a timer, kicking itself periodically; if polling yields no packets it disables tx exit mitigation. This saves the guest the bother of programming the timer, which presumably requires an exit if the timer is the closest one to expiration.

[btw, this can be implemented in virtqueue rather than virtio-net, no?]

Signature · 9 lines
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

A message that is not in the archive (sent off-list or not yet received): 47675AE0.8050808-atKUWr5tajBWk0Htik3J/[email protected]

#27 lore raw
Quoted 14 lines · On Tuesday 18 December 2007 16:30:08 Avi Kivity wrote:
Quoted 3 lines · Rusty Russell

Yes, I pondered this when I wrote the code. On the one hand, it's a
low-probability pathological corner case, on the other, your patch reduces the number of timer reprograms in the normal case.

One thing that came up in our discussions is to let the host do the timer processing instead of the guest. When tx exit mitigation is enabled, the guest bumps the queue pointer, but carefully refrains from kicking the host. The host polls the tx pointer using a timer, kicking itself periodically; if polling yields no packets it disables tx exit mitigation. This saves the guest the bother of programming the timer, which presumably requires an exit if the timer is the closest one to expiration.

Quoted 1 line

[btw, this can be implemented in virtqueue rather than virtio-net, no?]

Yes, the current patch is a hack (look at the hardcoded constant); wanted to see how much it helps, if any.

More sophisticated timer management would be a definite win... funny, I have a patch here which helps that....

Rusty.

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

#28 lore raw
In reply to Avi Kivity
Quoted 14 lines · On Tuesday 18 December 2007 16:30:08 Avi Kivity wrote:
Quoted 3 lines · Rusty Russell

Yes, I pondered this when I wrote the code. On the one hand, it's a
low-probability pathological corner case, on the other, your patch reduces the number of timer reprograms in the normal case.

One thing that came up in our discussions is to let the host do the timer processing instead of the guest. When tx exit mitigation is enabled, the guest bumps the queue pointer, but carefully refrains from kicking the host. The host polls the tx pointer using a timer, kicking itself periodically; if polling yields no packets it disables tx exit mitigation. This saves the guest the bother of programming the timer, which presumably requires an exit if the timer is the closest one to expiration.

Quoted 1 line

[btw, this can be implemented in virtqueue rather than virtio-net, no?]

Yes, the current patch is a hack (look at the hardcoded constant); wanted to see how much it helps, if any.

More sophisticated timer management would be a definite win... funny, I have a patch here which helps that....

Rusty.

#29 lore raw
In reply to a message not in the archive
Quoted 17 lines · Rusty Russell
Quoted 7 lines · On Wednesday 12 December 2007 23:54:00 Dor Laor wrote:

commit 763769621d271d92204ed27552d75448587c1ac0

Author: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/[email protected]>
Date:   Wed Dec 12 14:52:00 2007 +0200

[virtio-net][PATCH] Don't arm tx hrtimer with a constant 50us each
transmit

Quoted 7 lines

The current start_xmit sets 500us hrtimer to kick the host. The problem is that if another xmit happens before the timer was
fired then
the first xmit will have to wait additional 500us. This patch does not re-arm the timer if there is existing one. This will shorten the latency for tx.

Quoted 10 lines

Hi Dor!

Yes, I pondered this when I wrote the code. On the one hand, it's a
low-probability pathological corner case, on the other, your patch reduces the number of timer reprograms in the normal case.

So I've applied it, thanks!
Rusty.

Thanks, it actually improved my tx performance in 20%! Expecting the host side timer with your new patch. Cheers,
Dor.

Quoted 18 lines
Quoted 18 lines
drivers/net/virtio_net.c +0 -4
index 7b051d5..8bb17d1
@@ -406,10 +405,10 @@ again:
         virtio_debug(vdebug, "%s: before calling kick %d\n",
 __FUNCTION__, __LINE__);
         vi->svq->vq_ops->kick(vi->svq);
         vi->out_num = 0;
-    } else {
-        vi->stats.hrtimer_starts++;
-        hrtimer_start(&vi->tx_timer, ktime_set(0,500000),
-                  HRTIMER_MODE_REL);
Quoted 12 lines
Quoted 8 lines
drivers/net/virtio_net.c +4 -0
+    } else if (!hrtimer_is_queued(&vi->tx_timer)) {
+            vi->stats.hrtimer_starts++;
+            hrtimer_start(&vi->tx_timer, ktime_set(0,500000),
+                      HRTIMER_MODE_REL);
     }
     return 0;

}

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

#30 lore raw
In reply to Rusty Russell
Quoted 17 lines · Rusty Russell
Quoted 7 lines · On Wednesday 12 December 2007 23:54:00 Dor Laor wrote:

commit 763769621d271d92204ed27552d75448587c1ac0

Author: Dor Laor <[email protected]>
Date:   Wed Dec 12 14:52:00 2007 +0200

[virtio-net][PATCH] Don't arm tx hrtimer with a constant 50us each
transmit

Quoted 7 lines

The current start_xmit sets 500us hrtimer to kick the host. The problem is that if another xmit happens before the timer was
fired then
the first xmit will have to wait additional 500us. This patch does not re-arm the timer if there is existing one. This will shorten the latency for tx.

Quoted 5 lines

Hi Dor!

Yes, I pondered this when I wrote the code. On the one hand, it's a
low-probability pathological corner case, on the other, your patch reduces the number of timer reprograms in the normal case.

One thing that came up in our discussions is to let the host do the timer processing instead of the guest. When tx exit mitigation is enabled, the guest bumps the queue pointer, but carefully refrains from kicking the host. The host polls the tx pointer using a timer, kicking itself periodically; if polling yields no packets it disables tx exit mitigation. This saves the guest the bother of programming the timer, which presumably requires an exit if the timer is the closest one to expiration.

[btw, this can be implemented in virtqueue rather than virtio-net, no?]

Signature · 1 line
Any sufficiently difficult bug is indistinguishable from a feature.
author
#31 lore raw
In reply to Rusty Russell
Quoted 17 lines · Rusty Russell
Quoted 7 lines · On Wednesday 12 December 2007 23:54:00 Dor Laor wrote:

commit 763769621d271d92204ed27552d75448587c1ac0

Author: Dor Laor <[email protected]>
Date:   Wed Dec 12 14:52:00 2007 +0200

[virtio-net][PATCH] Don't arm tx hrtimer with a constant 50us each
transmit

Quoted 7 lines

The current start_xmit sets 500us hrtimer to kick the host. The problem is that if another xmit happens before the timer was
fired then
the first xmit will have to wait additional 500us. This patch does not re-arm the timer if there is existing one. This will shorten the latency for tx.

Quoted 10 lines

Hi Dor!

Yes, I pondered this when I wrote the code. On the one hand, it's a
low-probability pathological corner case, on the other, your patch reduces the number of timer reprograms in the normal case.

So I've applied it, thanks!
Rusty.

Thanks, it actually improved my tx performance in 20%! Expecting the host side timer with your new patch. Cheers,
Dor.

Quoted 18 lines
Quoted 18 lines
drivers/net/virtio_net.c +0 -4
index 7b051d5..8bb17d1
@@ -406,10 +405,10 @@ again:
         virtio_debug(vdebug, "%s: before calling kick %d\n",
 __FUNCTION__, __LINE__);
         vi->svq->vq_ops->kick(vi->svq);
         vi->out_num = 0;
-    } else {
-        vi->stats.hrtimer_starts++;
-        hrtimer_start(&vi->tx_timer, ktime_set(0,500000),
-                  HRTIMER_MODE_REL);
Quoted 12 lines
Quoted 8 lines
drivers/net/virtio_net.c +4 -0
+    } else if (!hrtimer_is_queued(&vi->tx_timer)) {
+            vi->stats.hrtimer_starts++;
+            hrtimer_start(&vi->tx_timer, ktime_set(0,500000),
+                      HRTIMER_MODE_REL);
     }
     return 0;

}

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/virtualization

#32 lore raw
In reply to Dor Laor
Quoted 7 lines · On Wednesday 12 December 2007 23:54:00 Dor Laor wrote:

commit 763769621d271d92204ed27552d75448587c1ac0

Author: Dor Laor <[email protected]>
Date:   Wed Dec 12 14:52:00 2007 +0200

[virtio-net][PATCH] Don't arm tx hrtimer with a constant 50us each
transmit

Quoted 6 lines

The current start_xmit sets 500us hrtimer to kick the host. The problem is that if another xmit happens before the timer was
fired then
the first xmit will have to wait additional 500us. This patch does not re-arm the timer if there is existing one. This will shorten the latency for tx.

Hi Dor!

Yes, I pondered this when I wrote the code. On the one hand, it's a
low-probability pathological corner case, on the other, your patch reduces the number of timer reprograms in the normal case.

So I've applied it, thanks!
Rusty.

Quoted 23 lines
drivers/net/virtio_net.c +4 -4
index 7b051d5..8bb17d1
@@ -406,10 +405,10 @@ again:
         virtio_debug(vdebug, "%s: before calling kick %d\n",
 __FUNCTION__, __LINE__);
         vi->svq->vq_ops->kick(vi->svq);
         vi->out_num = 0;
-    } else {
-        vi->stats.hrtimer_starts++;
-        hrtimer_start(&vi->tx_timer, ktime_set(0,500000),
-                  HRTIMER_MODE_REL);
+    } else if (!hrtimer_is_queued(&vi->tx_timer)) {
+            vi->stats.hrtimer_starts++;
+            hrtimer_start(&vi->tx_timer, ktime_set(0,500000),
+                      HRTIMER_MODE_REL);
     }
     return 0;

}