DragonFly-2.3.1.772.g1ae37 master sys/kern sys_pipe.c sys/sys pi

看板DFBSD_commit作者時間16年前 (2009/07/13 07:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
commit 1ae37239759b49870dcaae946fc436b7f9f53f73 Author: Matthew Dillon <dillon@apollo.backplane.com> Date: Sun Jul 12 15:42:43 2009 -0700 pipe - Make pipe r/w MPSAFE, add kern.pipe.mpsafe (disabled by default) * Make pipe_read and pipe_write MPSAFE. * Add a sysctl kern.pipe.mpsafe which defaults to disabled. Set to 1 to test the MPSAFE pipe code. The expectation is that it will be set to 1 for the release. Currently only pipe_read and pipe_write is MPSAFE. * The new code in mpsafe mode also implements a streaming optimization to avoid unnecessary tsleep/wakeup/IPIs. If the reader and writer are operating on different cpus this feature results in more uniform performance across a wide swath of block sizes. * The new code currently does not use any page mapping optimizations. Page table overhead is fairly nasty on SMP so for now we rely on cpu caches and do an extra copy. This means the code is tuned better for more recent cpus and tuned worse for older cpus. At least for now. OLD pipe code: dwe = dwrite_enable, sfb = dwrite_sfbuf mode NEW pipe code: mpsafe = 0 (gets bgl) or 1 (does not use bgl) Using /usr/src/test/sysperf/pipe2.c to test, all results in MBytes/sec 8K 16K 32K 64K 128K 256K ---- ---- ---- ---- ---- ---- OLD dwe=0 1193 1167 1555 1525 1473 1477 OLD dwe=1 sfb=0 856 1458 2307 2182 2275 2307 OLD dwe=1 sfb=1 955 1537 2300 2356 2363 2708 OLD dwe=1 sfb=2 939 1561 2367 2477 2379 2360 NEW mpsafe=0 1150 1369 1536 1591 1358 1270 NEW mpsafe=1 2133 2319 2375 2387 2396 2418 Summary of changes: sys/kern/sys_pipe.c | 865 +++++++++++++++++++++++++++++++++------------------ sys/sys/pipe.h | 22 +- 2 files changed, 577 insertions(+), 310 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1ae37239759b49870dcaae946fc436b7f9f53f73 -- DragonFly BSD source repository
文章代碼(AID): #1AMd9w7o (DFBSD_commit)