* [Bug nptl/4209] Performance issue: NPTL semaphores work slower than linuxthreads semaphores
2007-03-17 11:36 [Bug nptl/4209] New: Performance issue: NPTL semaphores work slower than linuxthreads semaphores bart dot vanassche at gmail dot com
@ 2007-03-17 11:38 ` bart dot vanassche at gmail dot com
2007-03-17 11:39 ` bart dot vanassche at gmail dot com
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: bart dot vanassche at gmail dot com @ 2007-03-17 11:38 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From bart dot vanassche at gmail dot com 2007-03-17 11:38 -------
Created an attachment (id=1624)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=1624&action=view)
Source code of test program
--
http://sourceware.org/bugzilla/show_bug.cgi?id=4209
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug nptl/4209] Performance issue: NPTL semaphores work slower than linuxthreads semaphores
2007-03-17 11:36 [Bug nptl/4209] New: Performance issue: NPTL semaphores work slower than linuxthreads semaphores bart dot vanassche at gmail dot com
2007-03-17 11:38 ` [Bug nptl/4209] " bart dot vanassche at gmail dot com
@ 2007-03-17 11:39 ` bart dot vanassche at gmail dot com
2007-03-17 16:46 ` drepper at redhat dot com
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: bart dot vanassche at gmail dot com @ 2007-03-17 11:39 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From bart dot vanassche at gmail dot com 2007-03-17 11:39 -------
Created an attachment (id=1625)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=1625&action=view)
Shell script that I used for compiling glibc 2.3.6, the most recent glibc with
linuxthreads support
--
http://sourceware.org/bugzilla/show_bug.cgi?id=4209
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug nptl/4209] Performance issue: NPTL semaphores work slower than linuxthreads semaphores
2007-03-17 11:36 [Bug nptl/4209] New: Performance issue: NPTL semaphores work slower than linuxthreads semaphores bart dot vanassche at gmail dot com
2007-03-17 11:38 ` [Bug nptl/4209] " bart dot vanassche at gmail dot com
2007-03-17 11:39 ` bart dot vanassche at gmail dot com
@ 2007-03-17 16:46 ` drepper at redhat dot com
2007-03-18 9:16 ` bart dot vanassche at gmail dot com
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: drepper at redhat dot com @ 2007-03-17 16:46 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From drepper at redhat dot com 2007-03-17 16:46 -------
And where is a bug? If you have proposals make them. Otherwise go away.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WORKSFORME
http://sourceware.org/bugzilla/show_bug.cgi?id=4209
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug nptl/4209] Performance issue: NPTL semaphores work slower than linuxthreads semaphores
2007-03-17 11:36 [Bug nptl/4209] New: Performance issue: NPTL semaphores work slower than linuxthreads semaphores bart dot vanassche at gmail dot com
` (2 preceding siblings ...)
2007-03-17 16:46 ` drepper at redhat dot com
@ 2007-03-18 9:16 ` bart dot vanassche at gmail dot com
2007-03-18 9:18 ` bart dot vanassche at gmail dot com
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: bart dot vanassche at gmail dot com @ 2007-03-18 9:16 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From bart dot vanassche at gmail dot com 2007-03-18 09:16 -------
(In reply to comment #3)
> And where is a bug? If you have proposals make them. Otherwise go away.
My proposal is to modify sem_post() such that it only calls lll_futex_wake() if
a thread is waiting in sem_wait(). This can be done by adding an atomic counter
to sem_t that represents the number of threads currently waiting inside sem_t.
This makes single-threaded usage of sem_post() and sem_wait() four times faster
[NPTL], and can speed up multithreaded usage of sem_post(). Of course this
optimization is only possible for semaphores used within the same process, and
not for semaphores shared over processes.
$ ./perf2
NPTL
mutex elapsed: 386132 us; per iteration: 38 ns.
semaphore elapsed: 2608915 us; per iteration: 260 ns.
custom semaphore elapsed: 163885 us; per iteration: 16 ns.
semaphore ping-pong elapsed: 19507114 us; per iteration: 1950 ns.
custom semaphore ping-pong elapsed: 10037632 us; per iteration: 1003 ns.
$ LD_LIBRARY_PATH=/home/bart/glibc236/lib: /home/bart/glibc236/lib/ld-linux.so.2
./glibc236-perf2
linuxthreads
mutex elapsed: 537161 us; per iteration: 53 ns.
semaphore elapsed: 1147894 us; per iteration: 114 ns.
custom semaphore elapsed: 156364 us; per iteration: 15 ns.
semaphore ping-pong elapsed: 28256860 us; per iteration: 2825 ns.
custom semaphore ping-pong elapsed: 18066323 us; per iteration: 1806 ns.
Note: because of the nature of this optimization the execution time of the
"custom semaphore ping-pong" test is much more variable than the execution time
of the other tests. It varies between 1000 ns per iteration (context switch time
?) and 2000 ns per iteration (context switch time + futex system call time ?).
--
http://sourceware.org/bugzilla/show_bug.cgi?id=4209
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug nptl/4209] Performance issue: NPTL semaphores work slower than linuxthreads semaphores
2007-03-17 11:36 [Bug nptl/4209] New: Performance issue: NPTL semaphores work slower than linuxthreads semaphores bart dot vanassche at gmail dot com
` (3 preceding siblings ...)
2007-03-18 9:16 ` bart dot vanassche at gmail dot com
@ 2007-03-18 9:18 ` bart dot vanassche at gmail dot com
2007-03-18 19:44 ` bart dot vanassche at gmail dot com
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: bart dot vanassche at gmail dot com @ 2007-03-18 9:18 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From bart dot vanassche at gmail dot com 2007-03-18 09:18 -------
Created an attachment (id=1628)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=1628&action=view)
Source code of second version of test program.
Includes a sample implementation of faster sem_post() and sem_wait() functions
and a performance test of these functions.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=4209
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug nptl/4209] Performance issue: NPTL semaphores work slower than linuxthreads semaphores
2007-03-17 11:36 [Bug nptl/4209] New: Performance issue: NPTL semaphores work slower than linuxthreads semaphores bart dot vanassche at gmail dot com
` (4 preceding siblings ...)
2007-03-18 9:18 ` bart dot vanassche at gmail dot com
@ 2007-03-18 19:44 ` bart dot vanassche at gmail dot com
2007-03-28 9:23 ` bart dot vanassche at gmail dot com
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: bart dot vanassche at gmail dot com @ 2007-03-18 19:44 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From bart dot vanassche at gmail dot com 2007-03-18 19:44 -------
(In reply to comment #4)
Sorry, but one of the above comments is wrong: on second thought, implementing a
semaphore waiter count will also work for process shared semaphores.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=4209
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug nptl/4209] Performance issue: NPTL semaphores work slower than linuxthreads semaphores
2007-03-17 11:36 [Bug nptl/4209] New: Performance issue: NPTL semaphores work slower than linuxthreads semaphores bart dot vanassche at gmail dot com
` (5 preceding siblings ...)
2007-03-18 19:44 ` bart dot vanassche at gmail dot com
@ 2007-03-28 9:23 ` bart dot vanassche at gmail dot com
2007-08-23 18:29 ` drepper at redhat dot com
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: bart dot vanassche at gmail dot com @ 2007-03-28 9:23 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From bart dot vanassche at gmail dot com 2007-03-28 10:23 -------
Above I added a suggestion for making the semaphore implementation faster.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|WORKSFORME |
http://sourceware.org/bugzilla/show_bug.cgi?id=4209
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug nptl/4209] Performance issue: NPTL semaphores work slower than linuxthreads semaphores
2007-03-17 11:36 [Bug nptl/4209] New: Performance issue: NPTL semaphores work slower than linuxthreads semaphores bart dot vanassche at gmail dot com
` (6 preceding siblings ...)
2007-03-28 9:23 ` bart dot vanassche at gmail dot com
@ 2007-08-23 18:29 ` drepper at redhat dot com
2007-09-03 9:07 ` bart dot vanassche at gmail dot com
2007-09-05 12:45 ` bart dot vanassche at gmail dot com
9 siblings, 0 replies; 11+ messages in thread
From: drepper at redhat dot com @ 2007-08-23 18:29 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From drepper at redhat dot com 2007-08-23 18:29 -------
For some time now the version in cvs does things differently. It of course is
always thread safe, unlike your code, so the benchmark as-is is not usable.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |FIXED
http://sourceware.org/bugzilla/show_bug.cgi?id=4209
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug nptl/4209] Performance issue: NPTL semaphores work slower than linuxthreads semaphores
2007-03-17 11:36 [Bug nptl/4209] New: Performance issue: NPTL semaphores work slower than linuxthreads semaphores bart dot vanassche at gmail dot com
` (7 preceding siblings ...)
2007-08-23 18:29 ` drepper at redhat dot com
@ 2007-09-03 9:07 ` bart dot vanassche at gmail dot com
2007-09-05 12:45 ` bart dot vanassche at gmail dot com
9 siblings, 0 replies; 11+ messages in thread
From: bart dot vanassche at gmail dot com @ 2007-09-03 9:07 UTC (permalink / raw)
To: glibc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Attachment #1625|application/octet-stream |text/plain
mime type| |
http://sourceware.org/bugzilla/show_bug.cgi?id=4209
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug nptl/4209] Performance issue: NPTL semaphores work slower than linuxthreads semaphores
2007-03-17 11:36 [Bug nptl/4209] New: Performance issue: NPTL semaphores work slower than linuxthreads semaphores bart dot vanassche at gmail dot com
` (8 preceding siblings ...)
2007-09-03 9:07 ` bart dot vanassche at gmail dot com
@ 2007-09-05 12:45 ` bart dot vanassche at gmail dot com
9 siblings, 0 replies; 11+ messages in thread
From: bart dot vanassche at gmail dot com @ 2007-09-05 12:45 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From bart dot vanassche at gmail dot com 2007-09-05 12:44 -------
(In reply to comment #8)
> For some time now the version in cvs does things differently. It of course is
> always thread safe, unlike your code, so the benchmark as-is is not usable.
Apparently these optimizations are not yet included in the most recent glibc
release (2.6.1) ? These are the changes I found in CVS:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/nptl/sysdeps/unix/sysv/linux/sem_post.c.diff?r1=1.6&r2=1.7&cvsroot=glibc&f=h
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/nptl/sysdeps/unix/sysv/linux/powerpc/sem_post.c.diff?r1=1.5&r2=1.6&cvsroot=glibc&f=h
...
--
http://sourceware.org/bugzilla/show_bug.cgi?id=4209
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread