cvs commit: src/sys/kern sysv_sem.c

Tim Robbins tjr at freebsd.org
Fri Dec 19 05:23:34 PST 2003


On Fri, Dec 19, 2003 at 05:07:17AM -0800, Tim J. Robbins wrote:
> tjr         2003/12/19 05:07:17 PST
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/kern             sysv_sem.c 
>   Log:
>   Reduce the overhead of semop() by using the kernel stack instead of
>   malloc'd memory to store the operations array if it is small enough
>   to fit.

FWIW, wall time for 100,000 increment/decrement pairs on a single semaphore:

x before
+ after
+--------------------------------------------------------------------------+
| ++ +                                                              xxx    |
|+++++ +                                                            xxx   x|
| |A_|                                                              |A_|   |
+--------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x   9          5.35           5.5          5.39     5.3933333   0.044440972
+   9           3.8          3.93          3.85     3.8566667   0.041231056
Difference at 95.0% confidence
	-1.53667 +/- 0.0428394
	-28.492% +/- 0.794303%
	(Student's t, pooled s = 0.0428661)


More information about the cvs-src mailing list