iperf: performance regression (was b44 driver problem?)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Stephen Hemminger
Date: Monday, June 4, 2007 - 9:59 am

On Mon, 04 Jun 2007 18:35:58 +0200
Thomas Gleixner <tglx@linutronix.de> wrote:


GLIBC pthread_mutex does it, YES it is a problem!
Looks like the old behavior is required for ABI compatibility.

iperf server has several threads. One thread is using pthread_mutex_lock
to wait for the other thread.  It looks like pthread_mutex_lock is using
nanosleep as yield().

Multi-thread strace shows how this could kill performance.
These are with old 2.6.20 kernel that doesn't have the problem:

sendto(-1210930208, 0xc, 3085438964, 0, {...}, 3084035240) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4)         = 0
bind(3, {sa_family=AF_INET, sin_port=htons(5001), sin_addr=inet_addr("0.0.0.0")}, 16)   = 0
listen(3, 5)                            = 0
futex(0x8055c64, 0x5 /* FUTEX_??? */, 1) = 1
accept(3, {sa_family=AF_INET, sin_port=htons(49973), sin_addr=inet_addr("192.168.0.14")}, [16]) = 4
getsockname(4, {sa_family=AF_INET, sin_port=htons(5001), sin_addr=inet_addr("192.168.0.12")}, [16]) = 0
recv(4, "\0\0\0\0\0\0\0\1\0\0\23\211\0\0\0\0\0\0\0\0\377\377\364"..., 24, 0) = 24
mmap2(NULL, 8392704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6528000
mprotect(0xb6528000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb6d284a4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACHED, parent_tidptr=0xb6d28bd8, {entry_number:6, base_addr:0xb6d28b90, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb6d28bd8) = 5622
accept(3, 0x8058b98, [128]) = ? ERESTARTSYS (To be restarted)

==============

sendto(-1219322912, 0xc, 3085438964, 0, {...}, 3075642536) = 0
futex(0x8055d04, 0x5 /* FUTEX_??? */, 1) = 1
futex(0x8055d30, FUTEX_WAKE, 1) = 1
futex(0x8055c64, FUTEX_WAIT, 1, NULL) = 0
futex(0x8055d04, 0x5 /* FUTEX_??? */, 1) = 1
futex(0x8055d30, FUTEX_WAKE, 1)         = 1
futex(0x8055c90, FUTEX_WAKE, 1)         = 0
getsockopt(3, SOL_SOCKET, SO_RCVBUF, [87380], [4]) = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fb0000
write(1, "--------------------------------"..., 61) = 61
write(1, "Server listening on TCP port 500"..., 34) = 34
write(1, "TCP window size: 85.3 KByte (def"..., 38) = 38
write(1, "--------------------------------"..., 61) = 61
nanosleep({0, 0}, NULL)                 = 0
futex(0x8055d04, 0x5 /* FUTEX_??? */, 1) = 1
futex(0x8055d30, FUTEX_WAKE, 1)         = 1
futex(0x8055c64, FUTEX_WAIT, 3, NULL) = 0
futex(0x8055c90, FUTEX_WAIT, 2, NULL)         = -1 EAGAIN (Resource temporarily unavailable)
futex(0x8055d04, 0x5 /* FUTEX_??? */, 1)                               = 1
futex(0x8055d30, FUTEX_WAKE, 1)                          = 0
futex(0x8055c90, FUTEX_WAKE, 1)                               = 0
write(1, "[  4] local 192.168.0.12 port 50"..., 74)                          = 74
nanosleep({0, 0}, NULL) = 0
nanosleep({0, 0}, NULL) = 0
nanosleep({0, 0}, NULL) = 0
nanosleep({0, 0}, NULL) = 0
nanosleep({0, 0}, NULL) = 0
nanosleep({0, 0}, NULL)                      = 0
nanosleep({0, 0}, NULL)                           = 0
nanosleep({0, 0}, NULL) = 0

...

nanosleep({0, 0}, NULL) = 0
nanosleep({0, 0}, NULL) = 0
nanosleep({0, 0}, NULL) = 0
nanosleep({0, 0}, NULL) = 0
nanosleep({0, 0}, NULL) = 0
nanosleep({0, 0}, NULL)                 = 0
write(1, "[  4]  0.0-30.2 sec    336 MByte"..., 50)                     = 50
nanosleep({0, 0}, NULL) = 0
nanosleep({0, 0}, NULL) = 0
futex(0x8055d04, 0x5 /* FUTEX_??? */, 1) = 1
futex(0x8055d30, FUTEX_WAKE, 1) = 0
futex(0x8055c64, FUTEX_WAIT, 5, NULL) = -1 EINTR (Interrupted system call)

===============

sendto(-1227715616, 0xc, 3085438964, 0, {...}, 3067249832) = 0
gettimeofday({1180973726, 981615}, NULL) = 0
gettimeofday({1180973726, 981751}, NULL) = 0
futex(0x8055c64, 0x5 /* FUTEX_??? */, 1) = 1
futex(0x8055c90, FUTEX_WAKE, 1) = 0
recv(4, "\0\0\0\0\0\0\0\1\0\0\23\211\0\0\0\0\0\0\0\0\377\377\364"..., 8192, 0) = 8192
gettimeofday({1180973726, 982754}, NULL) = 0
recv(4, "\0\0\0\0\0\0\0\1\0\0\23\211\0\0\0\0\0\0\0\0\377\377\364"..., 8192, 0) = 8192
gettimeofday({1180973726, 983790}, NULL) = 0
recv(4, "\0\0\0\0\0\0\0\1\0\0\23\211\0\0\0\0\0\0\0\0\377\377\364"..., 8192, 0) = 8192
gettimeofday({1180973726, 984355}, NULL) = 0
recv(4, "\0\0\0\0\0\0\0\1\0\0\23\211\0\0\0\0\0\0\0\0\377\377\364"..., 8192, 0) = 8192

...

gettimeofday({1180973757, 172338}, NULL) = 0
recv(4, "45678901234567890123456789012345"..., 8192, 0) = 1448
gettimeofday({1180973757, 172437}, NULL) = 0
recv(4, "23456789012345678901234567890123"..., 8192, 0) = 1448
gettimeofday({1180973757, 172576}, NULL) = 0
recv(4, "01234567890123456789012345678901"..., 8192, 0) = 1632
gettimeofday({1180973757, 172752}, NULL) = 0
recv(4, "", 8192, 0)                    = 0
gettimeofday({1180973757, 172797}, NULL) = 0
gettimeofday({1180973757, 172817}, NULL) = 0
nanosleep({0, 0}, NULL) = 0
nanosleep({0, 0}, NULL)                 = 0
close(4)                     = 0
futex(0x8055d04, 0x5 /* FUTEX_??? */, 1) = 1
futex(0x8055d30, FUTEX_WAKE, 1) = 0
_exit(0)                                = ?



-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: b44: regression in 2.6.22 (resend), Maximilian Engelhardt, (Sun May 27, 12:25 pm)
Re: b44: regression in 2.6.22 (resend), Michael Buesch, (Sun May 27, 12:45 pm)
Re: b44: regression in 2.6.22 (resend), Maximilian Engelhardt, (Sun May 27, 1:36 pm)
Re: b44: regression in 2.6.22 (resend), Michael Buesch, (Sun May 27, 1:46 pm)
Re: b44: regression in 2.6.22 (resend), Michael Buesch, (Sun May 27, 2:13 pm)
Re: b44: regression in 2.6.22 (resend), Michael Buesch, (Sun May 27, 2:16 pm)
Re: b44: regression in 2.6.22 (resend), Maximilian Engelhardt, (Sun May 27, 2:46 pm)
Re: b44: regression in 2.6.22 (resend), Maximilian Engelhardt, (Sun May 27, 2:50 pm)
Re: b44: regression in 2.6.22 (resend), Maximilian Engelhardt, (Sun May 27, 3:15 pm)
Re: b44: regression in 2.6.22 (resend), Michael Buesch, (Sun May 27, 5:24 pm)
Re: b44: regression in 2.6.22 (resend), Maximilian Engelhardt, (Sun May 27, 5:40 pm)
Re: b44: regression in 2.6.22 (resend), Michael Buesch, (Mon May 28, 3:16 am)
Re: b44: regression in 2.6.22 (resend), Michael Buesch, (Mon May 28, 3:49 am)
Re: b44: regression in 2.6.22 (resend), Maximilian Engelhardt, (Mon May 28, 7:09 am)
Re: b44: regression in 2.6.22 (resend), Maximilian Engelhardt, (Mon May 28, 7:12 am)
Re: b44: regression in 2.6.22 (resend), Michael Buesch, (Mon May 28, 7:55 am)
Re: b44: regression in 2.6.22 (resend), Michael Buesch, (Mon May 28, 8:14 am)
Re: b44: regression in 2.6.22 (resend), Thomas Gleixner, (Mon May 28, 8:32 am)
Re: b44: regression in 2.6.22 (resend), Michael Buesch, (Mon May 28, 8:43 am)
Re: b44: regression in 2.6.22 (resend), Maximilian Engelhardt, (Mon May 28, 10:44 am)
Re: b44: regression in 2.6.22 (resend), Thomas Gleixner, (Mon May 28, 12:23 pm)
Re: b44: regression in 2.6.22 (resend), Maximilian Engelhardt, (Mon May 28, 1:55 pm)
Re: b44: regression in 2.6.22 (resend), Thomas Gleixner, (Mon May 28, 2:45 pm)
Re: b44: regression in 2.6.22 (resend), Gary Zambrano, (Tue May 29, 6:58 am)
Re: b44: regression in 2.6.22 (resend), Gary Zambrano, (Tue May 29, 7:14 am)
Re: b44: regression in 2.6.22 (resend), Maximilian Engelhardt, (Tue May 29, 10:23 am)
Re: b44: regression in 2.6.22 (resend), Maximilian Engelhardt, (Tue May 29, 11:28 am)
Re: b44: regression in 2.6.22 (resend), Michael Buesch, (Tue May 29, 1:45 pm)
Re: b44: regression in 2.6.22 (resend), Stephen Hemminger, (Tue May 29, 2:01 pm)
Re: b44: regression in 2.6.22 (resend), Gary Zambrano, (Tue May 29, 2:05 pm)
Re: b44: regression in 2.6.22 (resend), Gary Zambrano, (Tue May 29, 2:36 pm)
Re: b44: regression in 2.6.22 (resend), Jeff Garzik, (Tue May 29, 3:39 pm)
Re: b44: regression in 2.6.22 (resend), Michael Buesch, (Wed May 30, 3:45 am)
Re: b44: regression in 2.6.22 (resend), Maximilian Engelhardt, (Sun Jun 3, 9:26 am)
Re: b44: regression in 2.6.22 (resend), Thomas Gleixner, (Sun Jun 3, 11:39 pm)
Re: b44: regression in 2.6.22 (resend), Stephen Hemminger, (Mon Jun 4, 9:09 am)
Re: b44: regression in 2.6.22 (resend), Thomas Gleixner, (Mon Jun 4, 9:35 am)
iperf: performance regression (was b44 driver problem?), Stephen Hemminger, (Mon Jun 4, 9:59 am)
Re: iperf: performance regression (was b44 driver problem?), Thomas Gleixner, (Mon Jun 4, 10:32 am)
Re: iperf: performance regression (was b44 driver problem?), Stephen Hemminger, (Mon Jun 4, 10:51 am)
Re: iperf: performance regression (was b44 driver problem?), Thomas Gleixner, (Mon Jun 4, 12:00 pm)
Re: iperf: performance regression (was b44 driver problem?), Thomas Gleixner, (Mon Jun 4, 12:26 pm)
Re: iperf: performance regression (was b44 driver problem?), Maximilian Engelhardt, (Mon Jun 4, 12:47 pm)
Re: iperf: performance regression (was b44 driver problem?), Stephen Hemminger, (Mon Jun 4, 1:02 pm)
Re: iperf: performance regression (was b44 driver problem?), Maximilian Engelhardt, (Mon Jun 4, 1:52 pm)