Skip to contentSkip to conversation

Network performance regression between kvm-29 and kvm-31

DISCUSSION Aurelien Jarno 2 participants 6 messages Jul 20, 2007 – Jul 22, 2007 5 messages not in the archive KVM

lore
Share & tools
lore
#0 lore raw

Hi,

I have just noticed that there is a huge performance regression in network transfers between kvm-29 and kvm-31. Using the RTL8139 emulated card, I have seen the network speed has been divided by 27!!! I haven't made precise speed measurements with other emulated card, but the network speed has been reduced by the same order.

Those tests have been done on a Core 2 CPU.

After some tests I have seen that the problem lies in the user part. I will do a git bisect tomorrow to find the patch that has caused the problem, unless somebody already find it.

Cheers,
Aurelien

Signature · 9 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

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

#2 lore raw
Quoted 8 lines · Aurelien Jarno

Hi,

I have just noticed that there is a huge performance regression in network transfers between kvm-29 and kvm-31. Using the RTL8139 emulated card, I have seen the network speed has been divided by 27!!! I haven't made precise speed measurements with other emulated card, but the network speed has been reduced by the same order.

Quoted 5 lines

Those tests have been done on a Core 2 CPU.

After some tests I have seen that the problem lies in the user part. I will do a git bisect tomorrow to find the patch that has caused the problem, unless somebody already find it.

I finally didn't resist to run git bisect before going to bed...

The patch that causes the regression is:

commit 7d2e674835492040c9baddf0989a95abea9a8d0f

Author: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/[email protected]>
Date:   Sun Jul 15 15:08:23 2007 +0300

kvm: qemu: synchronous signal handling

in order to ensure that signals are handled with the global lock held, we block them, and dequeue them with sigtimedwait(). we can then call the handlers directly.

this ensures that the device model and internal qemu data structures are not corrupted by cpu 0 thread handling a signal while cpu 1 is servicing a pio or mmio request.

Signature · 9 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

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

#4 lore raw
Quoted 27 lines · Aurelien Jarno
Quoted 8 lines · Aurelien Jarno

Hi,

I have just noticed that there is a huge performance regression in network transfers between kvm-29 and kvm-31. Using the RTL8139 emulated card, I have seen the network speed has been divided by 27!!! I haven't made precise speed measurements with other emulated card, but the network speed has been reduced by the same order.

Quoted 6 lines

Those tests have been done on a Core 2 CPU.

After some tests I have seen that the problem lies in the user part. I will do a git bisect tomorrow to find the patch that has caused the problem, unless somebody already find it.

I finally didn't resist to run git bisect before going to bed...

The patch that causes the regression is:

commit 7d2e674835492040c9baddf0989a95abea9a8d0f

Author: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/[email protected]>
Date:   Sun Jul 15 15:08:23 2007 +0300

kvm: qemu: synchronous signal handling

Quoted 9 lines

in order to ensure that signals are handled with the global lock held, we block them, and dequeue them with sigtimedwait(). we can then call the handlers directly.

this ensures that the device model and internal qemu data structures are not corrupted by cpu 0 thread handling a signal while cpu 1 is servicing a pio or mmio request.

Is this with -net user or -net tap?

Signature · 7 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

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

#6 lore raw
Quoted 31 lines · Avi Kivity
Quoted 30 lines · Aurelien Jarno
Quoted 8 lines · Aurelien Jarno

Hi,

I have just noticed that there is a huge performance regression in network transfers between kvm-29 and kvm-31. Using the RTL8139 emulated card, I have seen the network speed has been divided by 27!!! I haven't made precise speed measurements with other emulated card, but the network speed has been reduced by the same order.

Quoted 6 lines

Those tests have been done on a Core 2 CPU.

After some tests I have seen that the problem lies in the user part. I will do a git bisect tomorrow to find the patch that has caused the problem, unless somebody already find it.

I finally didn't resist to run git bisect before going to bed...

The patch that causes the regression is:

commit 7d2e674835492040c9baddf0989a95abea9a8d0f

Author: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/[email protected]>
Date:   Sun Jul 15 15:08:23 2007 +0300

kvm: qemu: synchronous signal handling

in order to ensure that signals are handled with the global lock held, we block them, and dequeue them with sigtimedwait(). we can then call the handlers directly.

Quoted 8 lines
Quoted 5 lines

this ensures that the device model and internal qemu data structures are not corrupted by cpu 0 thread handling a signal while cpu 1 is servicing a pio or mmio request.

Is this with -net user or -net tap?

With -net tap.

Signature · 9 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

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

#8 lore raw
Quoted 21 lines · Aurelien Jarno
Quoted 21 lines
Quoted 21 lines

I finally didn't resist to run git bisect before going to bed...

The patch that causes the regression is:

commit 7d2e674835492040c9baddf0989a95abea9a8d0f

Author: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/[email protected]>
Date:   Sun Jul 15 15:08:23 2007 +0300

kvm: qemu: synchronous signal handling

in order to ensure that signals are handled with the global lock held, we block them, and dequeue them with sigtimedwait(). we can then call the handlers directly.

this ensures that the device model and internal qemu data structures are not corrupted by cpu 0 thread handling a signal while cpu 1 is servicing a pio or mmio request.

Quoted 7 lines
Quoted 3 lines

Is this with -net user or -net tap?

With -net tap.

I pushed a commit which fixes a latency issue with that commit. However with my test (ping -f against the host) I only get a x2 performance increase. Can you test kvm-userspace.git? And can you detail your benchmark?

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

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

#10 lore raw
Quoted 26 lines · Avi Kivity
Quoted 25 lines · Aurelien Jarno
Quoted 24 lines
Quoted 11 lines

I finally didn't resist to run git bisect before going to bed...

The patch that causes the regression is:

commit 7d2e674835492040c9baddf0989a95abea9a8d0f

Author: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/[email protected]>
Date:   Sun Jul 15 15:08:23 2007 +0300

kvm: qemu: synchronous signal handling

Quoted 10 lines

in order to ensure that signals are handled with the global lock held, we block them, and dequeue them with sigtimedwait(). we can then call the handlers directly.

this ensures that the device model and internal qemu data structures are not corrupted by cpu 0 thread handling a signal while cpu 1 is servicing a pio or mmio request.

Is this with -net user or -net tap?

Quoted 8 lines
Quoted 3 lines

With -net tap.

I pushed a commit which fixes a latency issue with that commit. However with my test (ping -f against the host) I only get a x2 performance increase. Can you test kvm-userspace.git? And can you detail your benchmark?

Yes, that fixes the problem. However it seems it has broken SMP support, I am not able to boot a linux guest with 2 CPU with this patch.

About my benchmark, I am just copying a big file using scp between the guest and the host, and I saw a drop from 7,5 MiB/s to 280 kiB/s.

Aurelien

Signature · 10 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/