DragonFly commits List (threaded) for 2009-07
DragonFly-184.108.40.2068.g880ffa master sys/kern sys_pipe.c
Author: Matthew Dillon <firstname.lastname@example.org>
Date: Sun Jul 12 22:14:43 2009 -0700
pipe - replace use of DELAY() with a better solution, add features.
* Use the new tsc functions to poll for new read data in a pipe for a short
period of time on a SMP box. This greatly increases the odds of a pipe
writer on one cpu being able to pipeline data to a reader on another cpu
without having to use an IPI or tsleep/wakeup.
For the pipe1 test this brings the synchronous communications path
over a pipe (Awrite, Bread, Bwrite, Aread) down from 7uS to around 2uS.
For the pipe2 test this value greatly reduces the number of IPIs
and improves bandwidth by a few hundred megabytes/sec (the old DELAY
did the same thing so there is no change for the pipe2 test).
* Add sysctl kern.pipe.delay which defaults to 5000 nanoseconds (5uS).
This is the maximum a pipe reader will wait for additional data before
falling back to tsleep/wakeup (and related ipis). pipe_delay may be
set to 0 to disable the function. I value of at least 3000 is
recomended. Pipelining large buffers efficiently requires a higher value,
say up to 8000 or so.
* Allow kern.pipe.mpsafe to be set to 2 which adds a predictive wakeup
when a writer is found to be stalled. This currently has no significant
effect on operations due to token collisions.
* Add statistics: kern.pipe.wblocked and kern.pipe.rblocked, counting
the number of times a pipe blocks in "pipewr" or "piperd".
* Fix MP races in pipe_ioctl().
Summary of changes:
sys/kern/sys_pipe.c | 119 +++++++++++++++++++++++++++++++++------------------
1 files changed, 77 insertions(+), 42 deletions(-)
DragonFly BSD source repository