Full dynticks CONFIGNOHZFULL feature.docx
- 文档编号:16361811
- 上传时间:2023-07-12
- 格式:DOCX
- 页数:87
- 大小:42.51KB
Full dynticks CONFIGNOHZFULL feature.docx
《Full dynticks CONFIGNOHZFULL feature.docx》由会员分享,可在线阅读,更多相关《Full dynticks CONFIGNOHZFULL feature.docx(87页珍藏版)》请在冰点文库上搜索。
FulldynticksCONFIGNOHZFULLfeature
[GITPULL,RFC]Fulldynticks,CONFIG_NO_HZ_FULLfeature
[PostedMay7,2013bycorbet]
From:
IngoMolnar
To:
LinusTorvalds
Subject:
[GITPULL,RFC]Fulldynticks,CONFIG_NO_HZ_FULLfeature
Date:
Sun,5May201313:
03:
51+0200
Message-ID:
<20130505110351.GA4768@>
Cc:
linux-kernel-AT-vger.kernel.org,=?
iso-8859-1?
Q?
Fr=E9d=E9ric?
=Weisbecker
Archive-link:
Article,Thread
Linus,
Pleaseconsiderpullingthelatesttimers-nohz-for-linusgittreefrom:
git:
//git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gittimers-nohz-for-linus
HEAD:
265f22a975c1e4cc3a4d1f94a3ec53ffbb6f5b9fsched:
Keepatleast1tickpersecondforactive
dyntickstasks
ThistreefromFredericWeisbeckeraddsanew,(exciting!
:
-)corekernel
featuretothetimerandschedulersubsystems:
'fulldynticks',or
CONFIG_NO_HZ_FULL=y.
Thisfeatureextendsthenohzvariable-sizetimertickfeaturefromidle
tobusyCPUs(runningatmostonetask)aswell,potentiallyreducingthe
numberoftimerinterruptssignificantly.
Thisfeaturegotmotivatedbyreal-timefolksandthe-rttree,butthe
generalutilityandmotivationoffull-dynticksrunswiderthanthat:
-HPCworkloadsgetfaster:
CPUsrunningasingletaskshouldbeableto
utilizeamaximumamountofCPUpower.AperiodictimertickatHZ=1000
cancauseaconstantoverheadofupto1.0%.Thisfeatureremovesthat
overhead-andspeedsupthesystemby0.5%-1.0%ontypicaldistro
configsevenonmodernsystems.
-Real-timeworkloadlatencyreduction:
CPUsrunningcriticaltasks
shouldexperienceaslittlejitteraspossible.Thelastremaining
sourceofkernel-relatedjitterwastheperiodictimertick.
-AsingletaskexecutingonaCPUisaprettycommonsituation,
especiallywithanincreasingnumberofcores/CPUs,sothisfeature
helpsdesktopandmobileworkloadsaswell.
Thecostofthefeatureismainlyrelatedtoincreasedtimer-reprogramming
overheadwhenaCPUswitchesitstickperiod,andthusslightlylonger
to-idleandfrom-idlelatency.
Configuration-wiseathirdmodeofoperationisaddedtotheexistingtwo
NOHZkconfigmodes:
-CONFIG_HZ_PERIODIC:
[formerly!
CONFIG_NO_HZ],nowexplicitlynamedasa
configoption.ThisisthetraditionalLinuxperiodictickdesign:
there'saHZtickgoingonallthetime,regardlessofwhetheraCPUis
idleornot.
-CONFIG_NO_HZ_IDLE:
[formerlyCONFIG_NO_HZ=y],thisturnsoffthe
periodictickwhenaCPUentersidlemode.
-CONFIG_NO_HZ_FULL:
thisnewmode,inadditiontoturningoffthetick
whenaCPUisidle,alsoslowsthetickdownto1Hz(onetimer
interruptpersecond)whenonlyasingletaskisrunningonaCPU.
The.configbehavioriscompatible:
existing!
CONFIG_NO_HZand
CONFIG_NO_HZ=ysettingsgettranslatedtothenewvalues,withouttheuser
havingtoconfigureanything.CONFIG_NO_HZ_FULListurnedoffbydefault.
Thisfeatureisbasedonalotofinfrastructureworkthathasbeen
steadilygoingupstreaminthelast2-3cycles:
relatedRCUsupportand
non-periodiccputimesupportinparticularisupstreamalready.
Thistreeaddsthefinalpiecesandactivatesthefeature.Thepull
requestismarkedRFCbecause:
-it'smarked64-bitonlyatthemoment-the32-bitsupportpatchis
smallbutdidnotgetreadyintime.
-ithasanumberoffreshcommitsthatcameinafterthemergewindow.
Theoverwhelmingmajorityofcommitsarefrombeforethemergewindow,
butstillsomeaspectsofthetreearefreshandsoImarkeditRFC.
-it'saprettywide-reachingfeaturewithlotsofeffects-andwhile
thecomponentshavebeenintestingforsometime,thefullcombination
isstillnotverywidelyused.Thatit'sdefault-offshouldreduceits
regressionabilitiesandobviouslytherearenoknownregressionswith
CONFIG_NO_HZ_FULL=yenabledeither.
-thefeatureisnotcompletelyidempotent:
thereisno100%equivalent
replacementforaperiodicscheduler/timertick.Inparticularthere's
ongoingworktomapoutandreduceitseffectsonscheduler
load-balancingandstatistics.Thisshouldnotimpactcorrectness
though,therearenoknownregressionsrelatedtothisfeatureatthis
point.
-it'saprettyambitiousfeaturethatwithtimewilllikelybeenabled
bymostLinuxdistros,andwe'dlikeyoutomakeinputonits
design/implementation,ifyoudislikesomeaspectwemissed.Without
flamingustocrisp!
:
-)
Futureplans:
-there'songoingworktoreduce1Hzto0Hz,toessentiallyshut
offtheperiodictickaltogetherwhenthere'sasinglebusytaskona
CPU.We'dfirstlike1Hztobeexposedmorewidelybeforewegofor
the0Hztargetthough.
-oncewereach0Hzwecanandremovetheperiodictickassumptionfrom
nr_running>=2aswell,byessentiallyinterruptingbusytasksonlyas
frequentlyasthesched_latencyconstraintsrequireustodo-once
every4-40msecs,dependingonnr_running.
Iampersonallyleaningtowardsbitingthebulletanddoingthisinv3.10,
likethe-rttreethisefforthasbeengoingonfortoolong-butthe
finalwordisuptoyouasusual.
MoretechnicaldetailscanbefoundinDocumentation/timers/NO_HZ.txt.
Thanks,
Ingo
------------------>
FredericWeisbecker(34):
nohz:
Basicfulldynticksinterface
nohz:
AssigntimekeepingdutytoaCPUoutsidethefulldynticksrange
nohz:
WakeupfulldynticksCPUswhenatimergetsenqueued
nohz:
Unhidefulldynticksfeaturefromitsdependencies
nohz:
RenameCONFIG_NO_HZtoCONFIG_NO_HZ_COMMON
nohz:
PacknohzKconfigoptioninamenuofchoices
nohz:
PrintfinalfulldynticksCPUsrangeonboot
nohz:
FixolddynticksidleKconfigbackwardcompatibility
nohz:
Switchfrom"extendednohz"to"fullnohz"basednaming
nohz:
AlignperiodictickKconfigwithotherchoices'namingconvention
nohz:
ImproveabitthefulldynticksKconfigdocumentation
nohz:
NewAPIstore-evaluatethetickonfulldynticksCPUs
nohz:
ForcebootCPUoutsidefulldynticksrange
nohz:
EnsurefulldynticksCPUsareRCUnocbs
nohz:
NewoptiontodefaultallCPUsinfulldynticksrange
posix_timers:
KickfulldynticksCPUswhenaposixcputimerisarmed
posix_timers:
NewAPItopreventfromstoppingthetickwhentimersarerunning
posix_timers:
Fixpre-conditiontostopthetickonfulldynticks
perf:
KickfulldynticksCPUifeventsrotationisneeded
perf:
NewhelpertopreventfulldynticksCPUsfromstoppingtick
sched:
KickfulldynticksCPUthathavemorethanonetaskenqueued.
sched:
Newhelpertopreventfromstoppingthetickinfulldynticks
nohz:
Re-evaluatethetickfromtheschedulerIPI
nohz:
Implementfulldyntickskick
nohz:
Preparetostopthetickonirqexit
nohz:
Re-evaluatethetickforthenewtaskafteracontextswitch
nohz:
DisablethetickwhenirqresumeinfulldynticksCPU
nohz:
SelectwideRCUnocbforfulldynticks
nohz:
Addbasictracing
nohz:
Fixunavailabletick_stoptracepointindynticksidle
nohz:
Removefulldynticks'superfluousdependencyonRCUtree
nohz:
SelectVIRT_CPU_ACCOUNTING_GENfromfulldynticksconfig
rcu:
Fixfulldynticks'dependencyonwideRCUnocbmode
sched:
Keepatleast1tickpersecondforactivedyntickstasks
IngoMolnar
(1):
nohz:
Reduceoverheadunderhigh-freqidlingpatterns
KevinHilman
(1):
cputime_nsecs:
usemath64.hfornsecresolutionconversionhelpers
LiZhong
(1):
nohz:
Protectsmp_processor_id()intick_nohz_task_switch()
PaulE.McKenney
(2):
rcu:
Kickadaptive-ticksCPUsthatareholdingupRCUgraceperiods
nohz_full:
Adddocumentation.
Documentation/RCU/stallwarn.txt|2+-
Documentation/cpu-freq/governors.txt|4+-
Documentation/kernel-parameters.txt|8+
Documentation/timers/NO_HZ.txt|273+++++++++++++++++++++++++++++
arch/um/include/shared/common-offsets.h|4+-
arch/um/os-Linux/time.c|2+-
include/asm-generic/cputime_nsecs.h|28++-
include/linux/perf_event.h|6+
include/linux/posix-timers.h|2+
include/linux/rcupdate.h|7+
include/linux/sched.h|19+-
include/linux/tick.h|25++-
include/trace/events/timer.h|21+++
init/Kconfig|12+-
init/main.c|1+
kernel/events/core.c|17+-
kernel/hrtimer.c|4+-
kernel/posix-cpu-timers.c|76++++++--
kernel/rcutree.c|16+-
kernel/rcutree.h|2+-
kernel/rcutree_plugin.h|29+++-
kernel/sched/core.c|92++++++++--
kernel/sched/fair.c|10+-
kernel/sched/idle_task.c|1+
kernel/sched/sched.h|25++-
kernel/softirq.c|19+-
kernel/time/Kconfig|80++++++++-
kernel/time/tick-broadcast.c|3+-
kernel/time/tick-common.c|5+-
kernel/time/tick-sched.c|296++++++++++++++++++++++++++++++--
kernel/timer.c|16+-
31fileschanged,988insertions(+),117deletions(-)
createmode100644Documentation/timers/NO_HZ.txt
diff--gita/Documentation/RCU/stallwarn.txtb/Documentation/RCU/stallwarn.txt
indexe38b8df..8e9359d100644
---a/Documentation/RCU/stallwarn.txt
+++b/Documentation/RCU/stallwarn.txt
@@-191,7+191,7@@oACPU-boundreal-timetaskinaCONFIG_PREEMPT_RTkernelthat
oAhardwareorsoftwareissueshutsoffthescheduler-clock
interruptonaCPUthatisnotindyntick-idlemode.This
problemreallyhashappened,andseemstobemostlikelyto
-resultinRCUCPUstallwarningsforCONFIG_NO_HZ=nkernels.
+resultinRCUCPUstallwarningsforCONFIG_NO_HZ_COMMON=nkernels.
oAbugintheRCUimplementation.
diff--gita/Documentation/cpu-freq/
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Full dynticks CONFIGNOHZFULL feature