Вести с полей
- From
- Slawa Olhovchenkov (2:5030/500)
- To
- All
- Date
- 2007-01-01T23:45:10Z
- Area
- RU.UNIX.BSD
Hello All!
davidxu 2006-12-20 04:40:39 UTC
FreeBSD src repository
Modified files:
sys/amd64/amd64 cpu_switch.S genassym.c machdep.c
sys/i386/i386 genassym.c machdep.c swtch.s
sys/ia64/ia64 machdep.c
sys/kern kern_umtx.c
sys/sys pcpu.h umtx.h
Log:
Add a lwpid field into per-cpu structure, the lwpid represents current
running thread's id on each cpu. This allow us to add in-kernel adaptive
spin for user level mutex. While spinning in user space is possible,
without correct thread running state exported from kernel, it hardly
can be implemented efficiently without wasting cpu cycles, however
exporting thread running state unlikely will be implemented soon as
it has to design and stablize interfaces. This implementation is
transparent to user space, it can be disabled dynamically. With this
change, mutex ping-pong program's performance is improved massively on
SMP machine. performance of mysql super-smack select benchmark is increased
about 7% on Intel dual dual-core2 Xeon machine, it indicates on systems
which have bunch of cpus and system-call overhead is low (athlon64, opteron,
and core-2 are known to be fast), the adaptive spin does help performance.
Added sysctls:
kern.threads.umtx_dflt_spins
if the sysctl value is non-zero, a zero umutex.m_spincount will
cause the sysctl value to be used a spin cycle count.
kern.threads.umtx_max_spins
the sysctl sets upper limit of spin cycle count.
Tested on: Athlon64 X2 3800+, Dual Xeon 5130
... Сэр, я ничего не хочу сказать, но, сэр, мухи... они редко ошибаются, сэр!
--- GoldED+/BSD 1.1.5
* Origin: (2:5030/500)
SEEN-BY: 50/12 203 400/814 450/186 1024 451/30 469/418 550/196 4614/20 4635/4
SEEN-BY: 5000/5000 5011/13 5012/46 5015/28 5019/26 5020/154 175 400 545 549
SEEN-BY: 5020/758 1523 1604 1630 2142 2238 2395 2450 2590 2871 4441 5021/3 29
SEEN-BY: 5022/128 5025/3 750 5027/12 5029/32 5030/500 556 966 1080 1900 1957
SEEN-BY: 5030/2828 5031/47 70 5035/38 5040/47 5042/13 5045/7 5049/50 97 5054/1
SEEN-BY: 5054/4 8 9 11 28 35 36 37 45 66 67 70 75 84 85 5059/9 37 5062/1 10
SEEN-BY: 5063/3 5064/7 5076/1 5077/70 5080/80 1003 5082/6 5083/21 5084/9
SEEN-BY: 5085/13 5090/108 5094/4 5095/20 5096/18 5099/11 6001/10
PATH: 5030/500 5020/4441 545 5054/1 37