Cri$cality*Monotonic.Scheduling.with Dynamic(Processor(Affini0es - - PowerPoint PPT Presentation

cri cality monotonic scheduling with dynamic processor
SMART_READER_LITE
LIVE PREVIEW

Cri$cality*Monotonic.Scheduling.with Dynamic(Processor(Affini0es - - PowerPoint PPT Presentation

Cri$cality*Monotonic.Scheduling.with Dynamic(Processor(Affini0es !Bjrn!B.!Brandenburg! !bbb@mpi2sw s.org Dagstuhl,*March*2015 1 This%talk:% Pragma&c %Mixed/Cri2cality%Scheduling How$to$schedule$ $Vestal/style$dual/cri3cality$workloads$


slide-1
SLIDE 1

Cri$cality*Monotonic.Scheduling.with Dynamic(Processor(Affini0es

!Björn!B.!Brandenburg! !bbb@mpi2sws.org

Dagstuhl,*March*2015 1

slide-2
SLIDE 2

This%talk:%Pragma&c%Mixed/Cri2cality%Scheduling

How$to$schedule$ $Vestal/style$dual/cri3cality$workloads$ $on$exis%ng$RTOSs$(on$iden3cal$mul3processors)?!

  • 1. Processor)affini.es)are)readily(available)in)exis.ng,)already(

cer,fied)RTOSs.

  • 2. Processor)affini.es)are)useful)to)solve)Vestal3style)mixed<

cri.cality)scheduling)problems)on)mul,processors.

Dagstuhl,*March*2015 2

slide-3
SLIDE 3

De#facto!standard!interface:!Processor'Affinity

➞!restrict'the'set'of'processors'on'which'a'task'may'execute

Linux!—!sched_setaffinity(…) FreeBSD!—!cpuset_setaffinity(…) Windows!—!SetThreadAffinityMask(…) —!—!— QNX!—!ThreadCtl(_NTO_TCTL_RUNMASK, …) VxWorks!—!taskCpuAffinitySet(…) SYSGO9PikeOS!—!p4_thread_set_affinity(…) Green9Hills9Integrity!—!“tuMP&Affinity&Groups” RTEMS!—!_Scheduler_priority_affinity_SMP_Set_affinity(…)

Dagstuhl,*March*2015 3

slide-4
SLIDE 4

Processor'Affini,es'in'Prior'Work

As#an#implementa)on+detail:

  • structured"mul&processor"scheduling:

configure"global,"par((oned,"clustered"approaches

  • dynamic"processor"affini&es:"semi2par((oned"approaches

Dagstuhl,*March*2015 4

slide-5
SLIDE 5

Processor'Affini,es'in'Prior'Work

As#an#implementa)on+detail:

  • structured"mul&processor"scheduling:

configure"global,"par((oned,"clustered"approaches

  • dynamic"processor"affini&es:"semi2par((oned"approaches

As#a#first%class,#explicit#parameter:

  • unrestricted+arbitrary'processor'affini/es+(APAs):

each+task+has+an+explicit+affinity+[ECRTS’13,+RTSS’13,+RTSS’14]

Dagstuhl,*March*2015 5

slide-6
SLIDE 6

Real%Time)Scheduling)with)Processor)Affinity

Sporadic)task)with)affinity) )(=)set)of)allowed)processors):

  • Weak"APA"schedulers:"

"is"ready"but"not"scheduled"if"and"only"if" every"processor"in" "schedules"a"higher9priority"job.

  • Strong"APA"schedulers:"same"as"weak"APA"and"it"is"not"possible"to"

“rearrange”"(or"shi')"higher9priority"tasks"such"that" "becomes" scheduled"[RTSS’14].

Dagstuhl,*March*2015 6

slide-7
SLIDE 7

Processor'affini,es'can'be'used'to' improve(the(feasibility'of' cri2cality3monotonic(priori2es'on' mul,processors!

Dagstuhl,*March*2015 7

slide-8
SLIDE 8

Fixed&Priority,Scheduling,with, ,Cri$cality*Monotonic.Priori$es

➞!higher!cri(cality!=!higher!priority

Many%advantages%from%a%pragma&c%point%of%view:

  • simple,)trivial)to)implement,)no)budget)enforcement)required
  • obvious)isola)on)of)high7cri8cality)tasks
  • no+mode+switch,)no)“dropping”)of)low7cri8cality)tasks

Dagstuhl,*March*2015 8

slide-9
SLIDE 9

Feasibility*Limits

Cri$cality*monotonic.scheduling.can.be.infeasible.if.low$cri(cality. (LC).tasks.are.more%urgent.(=.$ghter.rela$ve.deadlines).than.high$ cri(cality.(HC).tasks. Example:

task criticality pi eL

i

eH

i

Ta low 2 1 – Tb high 10 3 6 low –

Dagstuhl,*March*2015 9

slide-10
SLIDE 10

…also&on&Mul*processors!

task criticality pi eL

i

eH

i

Ta low 2 1 – Tb high 10 3 6 Tc low 2 1 – Td high 10 2 5

On# #cores: ➞#global#infeasible#( #and# #miss#deadlines) ➞#par((oned#infeasible#( ,# ,# #each#need#a#separate#core).

Dagstuhl,*March*2015 10

slide-11
SLIDE 11

Processor'Affini,es'to'the'Rescue

Scheduling+strategy+on+ +cores+with+a+strong'APA+scheduler:

  • 1. Give'LC'tasks'global'affini0es:'

.

  • 2. Give'HC'tasks'par((oned'normal'affini*es:'

.

  • 3. When'a'HC'job'of'

'(resp.,' )'executes'for'more'than' '(resp.,' )' 0me'units,'give'it'an'augmented'affinity'of' .

  • 4. Reset'a'HC'task’s'affinity'to'its'normal'affinity'when'it'completes'its'job.

Dagstuhl,*March*2015 11

slide-12
SLIDE 12

Example(—(Normal(Mode

Ta = (1, −, 2) Tb = (3, 6, 10) Tc = (1, −, 2) Td = (2, 5, 10)

1 2 3 4 5 6 7 8 9 10

P1 P2 P1 P2 P2 P1 P2 P1 P2 P2 P2 P2

Ti = (eL

i , eH i , pi)

Normal:( (and( (

Dagstuhl,*March*2015 12

slide-13
SLIDE 13

Example(—(Degraded(Mode(for(

Ta = (1, −, 2) Tb = (3, 6, 10) Tc = (1, −, 2) Td = (2, 5, 10)

1 2 3 4 5 6 7 8 9 10 Ti = (eL

i , eH i , pi)

P1 P2 P1 P2 P2 P2 P1 P1 P2 P2 P1 P2 P2

Normal:( (and( ;(augmented(=( .

Dagstuhl,*March*2015 13

slide-14
SLIDE 14

Affinity'Augmented-Cri0cality'Monotonic-Scheduling

  • 1. Par$$on#HC#tasks,#according#to#normal'mode#execu5on#costs.

➔#should#typically#fit#on#a#small#number#of#cores#(one?)

  • 2. Assign#arbitrary#processor#affini5es#(APAs)#to#LC#tasks.

➔#Global#or#par55oned#are#op5ons,#beFer#choices#possible

  • 3. Determine#augmented#affini5es#for#HC#tasks.

➔#s.th.#all#HC#deadlines#met#even#if#all#tasks#degrade#together

  • 4. At#run$me,#switch#to#the#augmented#affinity#of#HC#job#when#it#

exceeds#its#normalMmode#execu5on#cost;#revert#at#job#comple5on.

Dagstuhl,*March*2015 14

slide-15
SLIDE 15

Advantages*of*the*Approach

  • Extends)support)for)cri1cality5monotonic)priori1es

➞)clearly'not'ideal,'but'simple'&'might'just'be'“good'enough”

  • Only)affinity)of)running)job)augmented,)not)all)jobs.

➞)No) )“mode)change”'opera9on'in'the'kernel! ➞)Does'not'require'full'budget'enforcement,'just'a'9mer.

  • Exis1ng)commercial)RTOSs)support)processor)affini1es.

➞)Easy)to)adopt:'no'kernelAlevel'changes'required.

Dagstuhl,*March*2015 15

slide-16
SLIDE 16

Open%Ques)on%1

Suppor&ng)Weak%APA)Schedulers

  • Linux'and'QNX'implement'weak,'not'strong,'APA'schedulers.
  • Other'major'RTOSs'presumably'do'so,'too.

➞'ImplementaCon'point'of'view:'it’s'the'“obvious”'first'aLempt.

  • How'to'support'the'sketched'scheme'on'exis%ng(&(mature(&(

previously(cer%fied,'but'weak'APA'schedulers? ➞'…'with'proper'choice'of'augmented'affiniCes'(I'think).'

Dagstuhl,*March*2015 16

slide-17
SLIDE 17

Open%Ques)on%2

Improved)HC)APA#Response*Time#Analysis

  • "is"given"by"uniprocessor"RTA"with"normal9mode"parameters.

"is"an"APA"response9=me"problem"(with"ji#er).

  • It"is"“unlikely”"(impossible?)"for"both"

"and" "to"be"maximal. ➞"Don’t&pay&twice!for!the!same!higher-priority!job’s!interference. ➞"Express"less"pessimis=c"bound"for" "as"a"func=on"of" .

Dagstuhl,*March*2015 17

slide-18
SLIDE 18

Cri$cality*Monotonic.Scheduling. .➕. .Processor'Affini,es

Simple,(Feasible,(Prac%cal( (&"poses"interes+ng"analysis"challenges( ( (Björn(Brandenburg(—(bbb@mpi7sws.org

Dagstuhl,*March*2015 18

slide-19
SLIDE 19

Appendix

Dagstuhl,*March*2015 19

slide-20
SLIDE 20

Preliminary*Schedulability*Analysis*(1/2)

assuming(strong(APA(&(there(are(at(most( (HC(tasks

Response'(me'of'a'LC#task: ➞'Given'by'(exis(ng)'APA'analysis'using'normal'mode'parameters Response'(me'of'a'HC#task:' '+' ,'where ➞' 'is'given'by'uniprocessor*RTA'using'normal1mode'parameters ➞'For'#HC' '(='dedicated'core):' .

Dagstuhl,*March*2015 20

slide-21
SLIDE 21

Preliminary*Schedulability*Analysis*(2/2)

if#there#are# #HC#tasks

HC#tasks#in#degraded#mode#no#longer#get#a#“dedicated”#core. ➞#an#APA#schedulability#problem HC#part#“released”#only#a1er#(poten3ally)# #3me#units. ➞#Need#APA#schedulability#analysis#with%support%for%ji-er!

Dagstuhl,*March*2015 21

slide-22
SLIDE 22

Open%Ques)on%3

Minimizing'Impact'on'Low0Cri3cality'Tasks

  • Finding'augmented'affini.es'for'HC'tasks'that'minimize&

disturbance'&'maximize'schedulability'for'LC'tasks.

  • AAer'a'disturbance,'what'is'the'maximum'interval'during'which'

LC'tasks'are'at'risk'of'missing'deadlines?

  • Slack'scheduling?

Dagstuhl,*March*2015 22

slide-23
SLIDE 23

Open%Ques)on%4

Generalizing*the*Approach

  • Mul%ple(levels(of(Cri%cality
  • Uncertain(task(parameters(other(than(WCET
  • General(schedulability(analysis(for(mul%processor(scheduling(

with(dynamic(processor(affini%es…

Dagstuhl,*March*2015 23