Table Of ContentMMäällaarrddaalleenn UUnniivveerrssiittyy PPrreessss DDiisssseerrttaattiioonnss
NNoo.. 119922
TTAASSKK AALLLLOOCCAATTIIOONN OOPPTTIIMMIIZZAATTIIOONN FFOORR
MMUULLTTIICCOORREE EEMMBBEEDDDDEEDD SSYYSSTTEEMMSS
JJuurraajj FFeelljjaann
22001155
SScchhooooll ooff IInnnnoovvaattiioonn,, DDeessiiggnn aanndd EEnnggiinneeeerriinngg
Mälardalen University Press Dissertations
No. 192
TASK ALLOCATION OPTIMIZATION FOR MULTICORE EMBEDDED SYSTEMS
Juraj Feljan
Akademisk avhandling
som för avläggande av teknologie doktorsexamen i datavetenskap vid
Akademin för innovation, design och teknik kommer att offentligen försvaras
fredagen den 18 december 2015, 14.15 i Kappa, Mälardalens högskola, Västerås.
Fakultetsopponent: Juniorprofessorin Anne Koziolek, Karlsruhe Institute of Technology
Copyright © Juraj Feljan, 2015
ISBN 978-91-7485-241-7
ISSN 1651-4238
Printed by Arkitektkopia, Västerås, Sweden
Akademin för innovation, design och teknik
Mälardalen University Press Dissertations
No. 192
Mälardalen University Press Dissertations
No. 192
TASK ALLOCATION OPTIMIZATION FOR MULTICORE EMBEDDED SYSTEMS
Juraj Feljan
TASK ALLOCATION OPTIMIZATION FOR MULTICORE EMBEDDED SYSTEMS
Juraj Feljan
Akademisk avhandling
som för avläggande av teknologie doktorsexamen i datavetenskap vid
Akademin för innovation, design och teknik kommer att offentligen försvaras
fredagen den 18 december 2015, 14.15 i Kappa, Mälardalens högskola, Västerås.
Akademisk avhandling
Fakultetsopponent: Juniorprofessorin Anne Koziolek, Karlsruhe Institute of Technology
som för avläggande av teknologie doktorsexamen i datavetenskap vid
Akademin för innovation, design och teknik kommer att offentligen försvaras
fredagen den 18 december 2015, 14.15 i Kappa, Mälardalens högskola, Västerås.
Fakultetsopponent: Juniorprofessorin Anne Koziolek, Karlsruhe Institute of Technology
Akademin för innovation, design och teknik
Akademin för innovation, design och teknik
Abstract
Modern embedded systems are becoming increasingly performance intensive, since, on the one hand,
they include more complex functionality than before, and one the other hand, the functionality that
was typically realized with hardware is often moved to software. Multicore technology, previously
successfully used for general-purpose systems, is penetrating into the domain of embedded systems.
While it does increase the performance capacity, it also introduces the problem of how to allocate
software tasks to the cores of the hardware platform, as different allocations exhibit different extra-
functional properties. An intuitive example is allocating too many tasks to a core --- the core will be
overloaded and tasks will miss their deadlines.
This thesis addresses the issue of task allocation in multicore embedded systems. The overall goal of the
thesis is to advance the way soft real-time multicore systems are developed, by providing new methods
and tools that enable deciding already at design-time which task to run on which core, with respect to
a number of timing-related extra-functional properties. To achieve this goal, we developed a model-
based framework for task allocation optimization. The framework uses model simulation in order to
Abstract
obtain performance predictions for particular task allocations. This in turn enables testing a large number
of allocation candidates in search for one that exhibits good timing-related performance. Apart from
defining and implementing the framework, three additional contributions are provided, each tackling a
particular aspect of the framework: the influence of task allocation on communication duration is studied
and interpreted in the context of design-time model-based analysis; a novel heuristic for guiding task
allocation optimization is defined; and finally, a novel optimization method combining performance
prediction and performance measurement is defined. Modernembeddedsystemsarebecomingincreasinglyperformancein-
tensive, since, on the one hand, they include more complex function-
ality than before, and one the other hand, the functionality that was
typicallyrealizedwithhardwareisoftenmovedtosoftware. Multicore
technology, previouslysuccessfullyusedforgeneral-purposesystems,
is penetrating into the domain of embedded systems. While it does
increase the performance capacity, it also introduces the problem of
how to allocate software tasks to the cores of the hardware platform,
asdifferentallocationsexhibitdifferentextra-functionalproperties. An
intuitiveexampleisallocatingtoomanytaskstoacore—thecorewill
beoverloadedandtaskswillmisstheirdeadlines.
This thesis addresses the issue of task allocation in multicore em-
bedded systems. The overall goal of the thesis is to advance the way
softreal-timemulticoresystemsaredeveloped,byprovidingnewmeth-
ods and tools that enable deciding already at design-time which task
torunonwhichcore,withrespecttoanumberoftiming-relatedextra-
functional properties. To achieve this goal, we developed a model-
basedframeworkfortaskallocationoptimization. Theframeworkuses
model simulation in order to obtain performance predictions for par-
ticular task allocations. This in turn enables testing a large number of
allocationcandidatesinsearchforonethatexhibitsgoodtiming-related
performance. Apart from defining and implementing the framework,
three additional contributions are provided, each tackling a particular
aspectoftheframework: theinfluenceoftaskallocationoncommuni-
cationdurationisstudiedandinterpretedinthecontextofdesign-time
model-basedanalysis;anovelheuristicforguidingtaskallocationopti-
mizationisdefined;andfinally,anoveloptimizationmethodcombining
performancepredictionandperformancemeasurementisdefined.
i
ISBN 978-91-7485-241-7
ISSN 1651-4238
Abstract
Modernembeddedsystemsarebecomingincreasinglyperformancein-
tensive, since, on the one hand, they include more complex function-
ality than before, and one the other hand, the functionality that was
typicallyrealizedwithhardwareisoftenmovedtosoftware. Multicore
technology, previouslysuccessfullyusedforgeneral-purposesystems,
is penetrating into the domain of embedded systems. While it does
increase the performance capacity, it also introduces the problem of
how to allocate software tasks to the cores of the hardware platform,
asdifferentallocationsexhibitdifferentextra-functionalproperties. An
intuitiveexampleisallocatingtoomanytaskstoacore—thecorewill
beoverloadedandtaskswillmisstheirdeadlines.
This thesis addresses the issue of task allocation in multicore em-
bedded systems. The overall goal of the thesis is to advance the way
softreal-timemulticoresystemsaredeveloped,byprovidingnewmeth-
ods and tools that enable deciding already at design-time which task
torunonwhichcore,withrespecttoanumberoftiming-relatedextra-
functional properties. To achieve this goal, we developed a model-
basedframeworkfortaskallocationoptimization. Theframeworkuses
model simulation in order to obtain performance predictions for par-
ticular task allocations. This in turn enables testing a large number of
allocationcandidatesinsearchforonethatexhibitsgoodtiming-related
performance. Apart from defining and implementing the framework,
three additional contributions are provided, each tackling a particular
aspectoftheframework: theinfluenceoftaskallocationoncommuni-
cationdurationisstudiedandinterpretedinthecontextofdesign-time
model-basedanalysis;anovelheuristicforguidingtaskallocationopti-
mizationisdefined;andfinally,anoveloptimizationmethodcombining
performancepredictionandperformancemeasurementisdefined.
i
Acknowledgements
Readingmycolleagues’acknowledgements(usuallyattheirdefenses)
Iwouldalwaysfindmyselfimagininghowitwouldfeeltobethereat
theendoftheroad,writinganacknowledgementofmyown. Andhere
Iamnow,worriedthatmywordswillnotsufficeindescribingtoyou,
mydearreader, theamazingperiodofmylifethatisnowbehindme.
In your hands (or on your screen) you have the most expected result
of a PhD, the thesis, but there is more to it than that. I learned a lot,
traveledalot,experiencedalot... Ichangedalotintheprocess. Thanks
tothePhDstudies,IgettosayIhavetwohomecountries,andIcannot
imagineanythingsointimidating,butatthesametimesoenrichingand
rewarding as moving to another country. But, probably the best part
of a PhD is how it awards you with getting to know many wonderful
people. Thisistoyou,itismyprivilegeandpleasuretoacknowledge
yourroleinthis,attimesdifficult,butmostlyremarkablejourney.
My deepest thanks goes to my advisors Ivica Crnkovic´ and Mario
ZˇagarforgivingmetheopportunitytobecomeaPhDstudent. Thank
youforbelievinginme,thankyouforalltheguidanceandsupport,both
professional and personal. Mostly, thank you for your patience. And
havingmentionedpatience—tomyco-advisorJanCarlson,thankyou
forenduringthroughthecountlessexcursionsIhadbothtoyouroffice
and to your e-mail inbox. At some point (or several points) you must
haveregrettedforhavingmeasyourPhDstudent:-). Iamamazedby
yourdeepknowledgeofmanyvariousareas,andtheimpressiveability
to quickly understand and solve detailed technical problems, while at
thesametimeneverloosingfocusfromthebigpicture. Ialwaysknew
you had my back, even in the face of the most depressing experiment
results. I am not exaggerating when I say that without you three this
thesisneverwouldhavecomeintoexistence.
iii
Acknowledgements
Readingmycolleagues’acknowledgements(usuallyattheirdefenses)
Iwouldalwaysfindmyselfimagininghowitwouldfeeltobethereat
theendoftheroad,writinganacknowledgementofmyown. Andhere
Iamnow,worriedthatmywordswillnotsufficeindescribingtoyou,
mydearreader, theamazingperiodofmylifethatisnowbehindme.
In your hands (or on your screen) you have the most expected result
of a PhD, the thesis, but there is more to it than that. I learned a lot,
traveledalot,experiencedalot... Ichangedalotintheprocess. Thanks
tothePhDstudies,IgettosayIhavetwohomecountries,andIcannot
imagineanythingsointimidating,butatthesametimesoenrichingand
rewarding as moving to another country. But, probably the best part
of a PhD is how it awards you with getting to know many wonderful
people. Thisistoyou,itismyprivilegeandpleasuretoacknowledge
yourroleinthis,attimesdifficult,butmostlyremarkablejourney.
My deepest thanks goes to my advisors Ivica Crnkovic´ and Mario
ZˇagarforgivingmetheopportunitytobecomeaPhDstudent. Thank
youforbelievinginme,thankyouforalltheguidanceandsupport,both
professional and personal. Mostly, thank you for your patience. And
havingmentionedpatience—tomyco-advisorJanCarlson,thankyou
forenduringthroughthecountlessexcursionsIhadbothtoyouroffice
and to your e-mail inbox. At some point (or several points) you must
haveregrettedforhavingmeasyourPhDstudent:-). Iamamazedby
yourdeepknowledgeofmanyvariousareas,andtheimpressiveability
to quickly understand and solve detailed technical problems, while at
thesametimeneverloosingfocusfromthebigpicture. Ialwaysknew
you had my back, even in the face of the most depressing experiment
results. I am not exaggerating when I say that without you three this
thesisneverwouldhavecomeintoexistence.
iii
iv
Next,Iwouldliketothanktwoadditionalpersonswhohadaspecial
role in my PhD studies. Thank you Tiberiu Seceleanu from ABB for
inspiring the topic of this thesis and for giving me the opportunity to
doaninternshipinABB.ThankyouFedericoCiccozziforpushingme
forward in the finishing stages of the studies with your great research
ideas and help with implementation. It has been a pleasure working
withyou. Contents
A big thank you to all my office-mates, all my co-authors, all the
people I had the pleasure of working with on various courses, all the
people that shared the joy and despair of developing an autonomous
underwaterrobotwithme,andtoalltheadministrativestaffthathelped
mewithvisas,apartments,ticketsandsimilarissues. Ispentagreatdeal
oftimeinthefirstphasesofmyPhDstudiesattheFacultyofelectrical 1 Introduction 1
engineering and computing at the University of Zagreb, so thank you 1.1 Researchgoalandquestions . . . . . . . . . . . . . . . . . 2
everybodywhomadethispossibleandenjoyable. 1.2 Researchmethodology . . . . . . . . . . . . . . . . . . . . 5
Myfriendsandcolleagues,thankyoufortheallthefun(andoften 1.3 Researchcontributions . . . . . . . . . . . . . . . . . . . . 6
extremelylively)lunchesandcoffeebreaks,andformakingtheuniver- 1.4 Publications . . . . . . . . . . . . . . . . . . . . . . . . . . 8
sity feel like home. Whenever I had to work late, at least one of you 1.5 Thesisoutline . . . . . . . . . . . . . . . . . . . . . . . . . 11
would be there in the same shoes, which always made me feel much
lesslonely. 2 Background 13
ThankyoutomyparentsLjerkaandJuraj,andmybrotherAndrija. 2.1 Model-basedanalysisandarchitectureoptimization . . . 13
Withoutyourloveandsupport,IwouldnotbewhereIamtoday. Also, 2.2 Real-timemulticoreembeddedsystems . . . . . . . . . . 15
thanksfornotturningmyoldroomintoastorageroom.
TomywifeAnetaandmydaughterEmili—thankyouformaking 3 Impactofallocationontaskcommunication 19
my life complete. Aneta, I admire your unselfish love, patience and 3.1 Memoryinamulticoreplatform . . . . . . . . . . . . . . 20
support. Thank you for always being there for me. Emili, you came 3.2 Investigatingtaskcommunication . . . . . . . . . . . . . 21
intothisworldjustbeforeIstartedwritingthethesis—thankyoufor 3.3 Experimentsetup . . . . . . . . . . . . . . . . . . . . . . . 22
alwaysputtingasmileonmyfaceandmakingthethesiswritingmuch 3.4 Experimentresults . . . . . . . . . . . . . . . . . . . . . . 25
lessstressfulthanIfeareditwouldbe. 3.5 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
And lastly, thank you dear reader for devoting your time to the
thesis,Ihopeyoufindwhatyouarelookingfor. 4 Taskallocationframework 31
4.1 Frameworkoverview . . . . . . . . . . . . . . . . . . . . . 32
JurajFeljan
4.1.1 Keydesigndecisions . . . . . . . . . . . . . . . . . 32
Stockholm,November2015
4.1.2 Structureoftheframework . . . . . . . . . . . . . 33
4.2 Frameworkimplementation . . . . . . . . . . . . . . . . . 35
4.2.1 Inputmodels . . . . . . . . . . . . . . . . . . . . . 36
ThisworkwassupportedbytheUnityThroughKnowledgeFoundthroughthe 4.2.2 Stopcriteria . . . . . . . . . . . . . . . . . . . . . . 38
DICESprojectandtheSwedishFoundationforStrategicResearchthroughthe 4.2.3 Simulationmechanism . . . . . . . . . . . . . . . . 39
Ralf3project(IIS11-0060). 4.2.4 Simulationmodel . . . . . . . . . . . . . . . . . . . 44
v
iv
Next,Iwouldliketothanktwoadditionalpersonswhohadaspecial
role in my PhD studies. Thank you Tiberiu Seceleanu from ABB for
inspiring the topic of this thesis and for giving me the opportunity to
doaninternshipinABB.ThankyouFedericoCiccozziforpushingme
forward in the finishing stages of the studies with your great research
ideas and help with implementation. It has been a pleasure working
withyou. Contents
A big thank you to all my office-mates, all my co-authors, all the
people I had the pleasure of working with on various courses, all the
people that shared the joy and despair of developing an autonomous
underwaterrobotwithme,andtoalltheadministrativestaffthathelped
mewithvisas,apartments,ticketsandsimilarissues. Ispentagreatdeal
oftimeinthefirstphasesofmyPhDstudiesattheFacultyofelectrical 1 Introduction 1
engineering and computing at the University of Zagreb, so thank you 1.1 Researchgoalandquestions . . . . . . . . . . . . . . . . . 2
everybodywhomadethispossibleandenjoyable. 1.2 Researchmethodology . . . . . . . . . . . . . . . . . . . . 5
Myfriendsandcolleagues,thankyoufortheallthefun(andoften 1.3 Researchcontributions . . . . . . . . . . . . . . . . . . . . 6
extremelylively)lunchesandcoffeebreaks,andformakingtheuniver- 1.4 Publications . . . . . . . . . . . . . . . . . . . . . . . . . . 8
sity feel like home. Whenever I had to work late, at least one of you 1.5 Thesisoutline . . . . . . . . . . . . . . . . . . . . . . . . . 11
would be there in the same shoes, which always made me feel much
lesslonely. 2 Background 13
ThankyoutomyparentsLjerkaandJuraj,andmybrotherAndrija. 2.1 Model-basedanalysisandarchitectureoptimization . . . 13
Withoutyourloveandsupport,IwouldnotbewhereIamtoday. Also, 2.2 Real-timemulticoreembeddedsystems . . . . . . . . . . 15
thanksfornotturningmyoldroomintoastorageroom.
TomywifeAnetaandmydaughterEmili—thankyouformaking 3 Impactofallocationontaskcommunication 19
my life complete. Aneta, I admire your unselfish love, patience and 3.1 Memoryinamulticoreplatform . . . . . . . . . . . . . . 20
support. Thank you for always being there for me. Emili, you came 3.2 Investigatingtaskcommunication . . . . . . . . . . . . . 21
intothisworldjustbeforeIstartedwritingthethesis—thankyoufor 3.3 Experimentsetup . . . . . . . . . . . . . . . . . . . . . . . 22
alwaysputtingasmileonmyfaceandmakingthethesiswritingmuch 3.4 Experimentresults . . . . . . . . . . . . . . . . . . . . . . 25
lessstressfulthanIfeareditwouldbe. 3.5 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
And lastly, thank you dear reader for devoting your time to the
thesis,Ihopeyoufindwhatyouarelookingfor. 4 Taskallocationframework 31
4.1 Frameworkoverview . . . . . . . . . . . . . . . . . . . . . 32
JurajFeljan 4.1.1 Keydesigndecisions . . . . . . . . . . . . . . . . . 32
Stockholm,November2015
4.1.2 Structureoftheframework . . . . . . . . . . . . . 33
4.2 Frameworkimplementation . . . . . . . . . . . . . . . . . 35
4.2.1 Inputmodels . . . . . . . . . . . . . . . . . . . . . 36
ThisworkwassupportedbytheUnityThroughKnowledgeFoundthroughthe 4.2.2 Stopcriteria . . . . . . . . . . . . . . . . . . . . . . 38
DICESprojectandtheSwedishFoundationforStrategicResearchthroughthe 4.2.3 Simulationmechanism . . . . . . . . . . . . . . . . 39
Ralf3project(IIS11-0060). 4.2.4 Simulationmodel . . . . . . . . . . . . . . . . . . . 44
v
vi Contents
4.2.5 Optimizationmechanism . . . . . . . . . . . . . . 47
4.3 Validationofthesimulationmechanism . . . . . . . . . . 52
4.3.1 Experimentsetup . . . . . . . . . . . . . . . . . . . 52
4.3.2 Experimentresults . . . . . . . . . . . . . . . . . . 57
4.3.3 Discussion . . . . . . . . . . . . . . . . . . . . . . . 64
4.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
List of Figures
5 Delaymatrixheuristic 67
5.1 Definitionoftheheuristic . . . . . . . . . . . . . . . . . . 67
5.2 Evaluationoftheheuristic . . . . . . . . . . . . . . . . . . 71
5.2.1 Experimentsetup . . . . . . . . . . . . . . . . . . . 71
5.2.2 Experimentresults . . . . . . . . . . . . . . . . . . 75
5.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
3.1 Taskcommunicationinadual-coresystem . . . . . . . . 22
3.2 Strideexamples . . . . . . . . . . . . . . . . . . . . . . . . 24
6 Enhancing model-based optimization with monitored system
3.3 Experimentresults . . . . . . . . . . . . . . . . . . . . . . 27
runs 83
6.1 Model-basedandexecution-basedarchitectureoptimiza-
4.1 Taskallocationframework . . . . . . . . . . . . . . . . . . 34
tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
4.2 Examplesoftwareandhardwaremodel . . . . . . . . . . 37
6.2 Model-based and execution-based task allocation opti-
mization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4.3 Scenarioshowingmultiplechaininstances . . . . . . . . 41
6.3 Experiment. . . . . . . . . . . . . . . . . . . . . . . . . . . 90 4.4 Exampleofsimulationvisualization: taskexecutiontrace 44
6.3.1 Experimentsetup . . . . . . . . . . . . . . . . . . . 90 4.5 Optimizationexample:averageend-to-endresponsetimes
6.3.2 Experimentresults . . . . . . . . . . . . . . . . . . 93 ofthecurrentcandidateandthebestcandidate . . . . . . 50
6.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 4.6 Validationsystems . . . . . . . . . . . . . . . . . . . . . . 56
4.7 Short-chainsystem,lowload . . . . . . . . . . . . . . . . 58
7 Relatedwork 99
4.8 Short-chainsystem,highload . . . . . . . . . . . . . . . . 59
7.1 Model-basedperformanceanalysisand
4.9 Long-chainsystem,lowload . . . . . . . . . . . . . . . . 60
architectureoptimization. . . . . . . . . . . . . . . . . . . 99
4.10 Long-chainsystem,highload . . . . . . . . . . . . . . . . 61
7.2 Taskallocationinreal-timesystems. . . . . . . . . . . . . 104
4.11 Mix-chainsystem,lowload . . . . . . . . . . . . . . . . . 62
8 Conclusion 109 4.12 Mix-chainsystem,highload . . . . . . . . . . . . . . . . . 63
8.1 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . 110
5.1 Experimentsystems. . . . . . . . . . . . . . . . . . . . . . 73
8.2 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
8.3 Futurework . . . . . . . . . . . . . . . . . . . . . . . . . . 116 5.2 Short-chainsystem,lowload . . . . . . . . . . . . . . . . 78
5.3 Long-chainsystem,lowload . . . . . . . . . . . . . . . . 78
Bibliography 119 5.4 Short-chainsystem,highload . . . . . . . . . . . . . . . . 79
5.5 Long-chainsystem,highload . . . . . . . . . . . . . . . . 80
A Impactofallocationontaskcommunication—Experimentre-
sults 127
6.1 Combined model-based and execution-based architec-
tureoptimization . . . . . . . . . . . . . . . . . . . . . . . 85
vii
Description:typically realized with hardware is often moved to software. Multicore technology . 2.1 Model-based analysis and architecture optimization . 13 .. and software performance engineering [5] advocate. The idea is to use .. Web, editing text, manipulating data, tracking inventory and so on. Supporting