DragonFly-2.3.1.808.g880ffa master sys/kern sys_pipe.c

看板DFBSD_commit作者時間16年前 (2009/07/13 13:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
commit 880ffa3a9be14e3d9608214aabd8db2e5e9238ae Author: Matthew Dillon <dillon@apollo.backplane.com> 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(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/880ffa3a9be14e3d9608214aabd8db2e5e9238ae -- DragonFly BSD source repository
文章代碼(AID): #1AMiRO45 (DFBSD_commit)