git: kernel - Optimize idle thread halt

看板DFBSD_commit作者時間15年前 (2010/12/20 03:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
commit be71787bd3c8d2d199af9bb30ffb6df730c6b858 Author: Matthew Dillon <dillon@apollo.backplane.com> Date: Sun Dec 19 11:17:36 2010 -0800 kernel - Optimize idle thread halt * Count the number of times the idle thread is entered on a cpu without switching to a non-idle thread. Use the fast-halt (non-ACPI) until the count exceeds a reasonable machdep.cpu_idle_repeat. This improves the default performance to levels closer to cpu_idle_hlt mode 1 but still gives us the power savings from mode 3. Performanced is improved significantly because many threads on SMP boxes are event or pipe oriented and only sleep for short periods of time or ping-pong back and forth. For example, a cc -pipe, or typical kernel threads blocking on tokens or locks for short periods of time. * Adjust machdep.cpu_idle_hlt modes: 0 Never halt, the idle thread just spins. 1 Always use a fast HLT/MONITOR/MWAIT 2 Hybrid approach use (1) up to a certain point, then use (3). (this is the default) 3 Always use the ACPI halt Summary of changes: sys/kern/lwkt_thread.c | 4 ++ sys/platform/pc32/i386/machdep.c | 55 ++++++++++++++++++++++++++++++----- sys/platform/pc64/x86_64/machdep.c | 47 ++++++++++++++++++++++++++---- sys/sys/globaldata.h | 5 ++- 4 files changed, 96 insertions(+), 15 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/be71787bd3c8d2d199af9bb30ffb6df730c6b858 -- DragonFly BSD source repository
文章代碼(AID): #1D3bsttl (DFBSD_commit)