[585d910] | 1 | % T I T L E P A G E |
---|
| 2 | % ------------------- |
---|
| 3 | % Last updated June 14, 2017, by Stephen Carr, IST-Client Services |
---|
| 4 | % The title page is counted as page `i' but we need to suppress the |
---|
| 5 | % page number. Also, we don't want any headers or footers. |
---|
| 6 | \pagestyle{empty} |
---|
| 7 | \pagenumbering{roman} |
---|
| 8 | |
---|
| 9 | % The contents of the title page are specified in the "titlepage" |
---|
| 10 | % environment. |
---|
[86c1f1c3] | 11 | \begin{titlepage} |
---|
[d835116] | 12 | \begin{center} |
---|
| 13 | \vspace*{1.0cm} |
---|
[585d910] | 14 | |
---|
[d835116] | 15 | \Huge |
---|
| 16 | {\bf The \CFA Scheduler} |
---|
[585d910] | 17 | |
---|
[d835116] | 18 | \vspace*{1.0cm} |
---|
[585d910] | 19 | |
---|
[d835116] | 20 | \normalsize |
---|
| 21 | by \\ |
---|
[585d910] | 22 | |
---|
[d835116] | 23 | \vspace*{1.0cm} |
---|
[585d910] | 24 | |
---|
[d835116] | 25 | \Large |
---|
| 26 | Thierry Delisle \\ |
---|
[585d910] | 27 | |
---|
[d835116] | 28 | \vspace*{3.0cm} |
---|
[585d910] | 29 | |
---|
[d835116] | 30 | \normalsize |
---|
| 31 | A thesis \\ |
---|
| 32 | presented to the University of Waterloo \\ |
---|
| 33 | in fulfillment of the \\ |
---|
| 34 | thesis requirement for the degree of \\ |
---|
| 35 | Doctor of Philosophy \\ |
---|
| 36 | in \\ |
---|
| 37 | Computer Science \\ |
---|
[585d910] | 38 | |
---|
[d835116] | 39 | \vspace*{2.0cm} |
---|
[585d910] | 40 | |
---|
[2c63fa2] | 41 | Waterloo, Ontario, Canada, 2022 \\ |
---|
[86c1f1c3] | 42 | |
---|
[d835116] | 43 | \vspace*{1.0cm} |
---|
[86c1f1c3] | 44 | |
---|
[2c63fa2] | 45 | \copyright\ Thierry Delisle 2022 \\ |
---|
[d835116] | 46 | \end{center} |
---|
[585d910] | 47 | \end{titlepage} |
---|
| 48 | |
---|
| 49 | % The rest of the front pages should contain no headers and be numbered using Roman numerals starting with `ii' |
---|
| 50 | \pagestyle{plain} |
---|
| 51 | \setcounter{page}{2} |
---|
| 52 | |
---|
| 53 | \cleardoublepage % Ends the current page and causes all figures and tables that have so far appeared in the input to be printed. |
---|
| 54 | % In a two-sided printing style, it also makes the next page a right-hand (odd-numbered) page, producing a blank page if necessary. |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | % E X A M I N I N G C O M M I T T E E (Required for Ph.D. theses only) |
---|
| 58 | % Remove or comment out the lines below to remove this page |
---|
| 59 | \begin{center}\textbf{Examining Committee Membership}\end{center} |
---|
[d835116] | 60 | \noindent |
---|
| 61 | The following served on the Examining Committee for this thesis. The decision of the Examining Committee is by majority vote. |
---|
| 62 | \bigskip |
---|
[585d910] | 63 | |
---|
[d835116] | 64 | \noindent |
---|
[585d910] | 65 | \begin{tabbing} |
---|
[d835116] | 66 | Internal-External Member: \= \kill % using longest text to define tab length |
---|
[7a0f798b] | 67 | External Examiner: \> Doug Lea \\ |
---|
[4407b7e] | 68 | \> Professor, Computer Science Department \\ |
---|
[7a0f798b] | 69 | \> State University of New York at Oswego \\ |
---|
[585d910] | 70 | \end{tabbing} |
---|
[d835116] | 71 | \bigskip |
---|
[585d910] | 72 | |
---|
[d835116] | 73 | \noindent |
---|
[585d910] | 74 | \begin{tabbing} |
---|
[d835116] | 75 | Internal-External Member: \= \kill % using longest text to define tab length |
---|
| 76 | Supervisor(s): \> Peter Buhr \\ |
---|
| 77 | \> Associate Professor, School of Computer Science \\ |
---|
| 78 | \> University of Waterloo \\ |
---|
[585d910] | 79 | \end{tabbing} |
---|
[d835116] | 80 | \bigskip |
---|
[585d910] | 81 | |
---|
[d835116] | 82 | \noindent |
---|
[585d910] | 83 | \begin{tabbing} |
---|
[d835116] | 84 | Internal-External Member: \= \kill % using longest text to define tab length |
---|
| 85 | Internal Member: \> Trevor Brown \\ |
---|
| 86 | \> Assistant Professor, School of Computer Science \\ |
---|
| 87 | \> University of Waterloo \\ |
---|
| 88 | \\ |
---|
| 89 | Internal Member: \> Martin Karsten \\ |
---|
[ddcaff6] | 90 | \> Professor, School of Computer Science \\ |
---|
[d835116] | 91 | \> University of Waterloo \\ |
---|
[585d910] | 92 | \end{tabbing} |
---|
[d835116] | 93 | \bigskip |
---|
[585d910] | 94 | |
---|
[d835116] | 95 | \noindent |
---|
[585d910] | 96 | \begin{tabbing} |
---|
[d835116] | 97 | Internal-External Member: \= \kill % using longest text to define tab length |
---|
[7a0f798b] | 98 | Internal-External Member: \> Patrick Lam \\ |
---|
| 99 | \> Associate Professor, Department of Electrical and Computer Engineering \\ |
---|
[d835116] | 100 | \> University of Waterloo \\ |
---|
[585d910] | 101 | \end{tabbing} |
---|
[d835116] | 102 | \bigskip |
---|
[585d910] | 103 | |
---|
| 104 | \cleardoublepage |
---|
| 105 | |
---|
| 106 | % D E C L A R A T I O N P A G E |
---|
| 107 | % ------------------------------- |
---|
[4e21942] | 108 | % The following is a sample Declaration Page as provided by the GSO |
---|
[d835116] | 109 | % December 13th, 2006. It is designed for an electronic thesis. |
---|
[5657de9] | 110 | \begin{center}\textbf{Author's Declaration}\end{center} |
---|
[d835116] | 111 | \noindent |
---|
[86c1f1c3] | 112 | I hereby declare that I am the sole author of this thesis. This is a true copy of the thesis, including any required final revisions, as accepted by my examiners. |
---|
| 113 | |
---|
[d835116] | 114 | \bigskip |
---|
[86c1f1c3] | 115 | |
---|
[d835116] | 116 | \noindent |
---|
[585d910] | 117 | I understand that my thesis may be made electronically available to the public. |
---|
[86c1f1c3] | 118 | |
---|
[585d910] | 119 | \cleardoublepage |
---|
[86c1f1c3] | 120 | |
---|
[585d910] | 121 | % A B S T R A C T |
---|
| 122 | % --------------- |
---|
[86c1f1c3] | 123 | |
---|
| 124 | \begin{center}\textbf{Abstract}\end{center} |
---|
| 125 | |
---|
[d0fcc82] | 126 | User-Level threading (M:N) is gaining popularity over kernel-level threading (1:1) in many programming languages. |
---|
[a44514e] | 127 | The user threading approach is often a better mechanism to express complex concurrent applications by efficiently running 10,000+ threads on multicore systems. |
---|
[3fe4acd] | 128 | Indeed, over-partitioning into small work-units with user threading significantly eases load bal\-ancing, while simultaneously providing advanced synchronization and mutual exclusion capabilities. |
---|
[d0fcc82] | 129 | To manage these high levels of concurrency, the underlying runtime must efficiently schedule many user threads across a few kernel threads; |
---|
[ddcaff6] | 130 | which raises the question of how many kernel threads are needed and should the number be dynamically reevaluated. |
---|
[4e21942] | 131 | Furthermore, scheduling must prevent kernel threads from blocking, otherwise user-thread parallelism drops. |
---|
[ddcaff6] | 132 | When user-threading parallelism does drop, how and when should idle \glspl{kthrd} be put to sleep to avoid wasting CPU resources? |
---|
[d0fcc82] | 133 | Finally, the scheduling system must provide fairness to prevent a user thread from monopolizing a kernel thread; |
---|
[918e0137] | 134 | otherwise, other user threads can experience short/long term starvation or kernel threads can deadlock waiting for events to occur on busy kernel threads. |
---|
[d0fcc82] | 135 | |
---|
[918e0137] | 136 | This thesis analyses multiple scheduler systems, where each system attempts to fulfill the requirements for user-level threading. |
---|
[62424af2] | 137 | The predominant technique for managing high levels of concurrency is sharding the ready queue with one queue per \gls{kthrd} and using some form of work stealing/sharing to dynamically rebalance workload shifts. |
---|
[a44514e] | 138 | Preventing kernel blocking is accomplished by transforming kernel locks and I/O operations into user-level operations that do not block the kernel thread or spin up new kernel threads to manage the blocking. |
---|
[4e21942] | 139 | Fairness is handled through preemption and/or ad-hoc solutions, which leads to coarse-grained fairness with some pathological cases. |
---|
[d0fcc82] | 140 | |
---|
[878be178] | 141 | After examining, selecting and testing specific approaches to these scheduling issues, a complete implementation was created and tested in the \CFA (C-for-all) runtime system. |
---|
[d0fcc82] | 142 | \CFA is a modern extension of C using user-level threading as its fundamental threading model. |
---|
| 143 | As one of its primary goals, \CFA aims to offer increased safety and productivity without sacrificing performance. |
---|
| 144 | The new scheduler achieves this goal by demonstrating equivalent performance to work-stealing schedulers while offering better fairness. |
---|
[4e21942] | 145 | The implementation uses several optimizations that successfully balance the cost of fairness against performance; |
---|
[80d16f8] | 146 | some of these optimizations rely on interesting hardware optimizations present on modern CPUs. |
---|
[4e21942] | 147 | The new scheduler also includes support for implicit nonblocking \io, allowing applications to have more user-threads blocking on \io operations than there are \glspl{kthrd}. |
---|
[80d16f8] | 148 | The implementation is based on @io_uring@, a recent addition to the Linux kernel, and achieves the same performance and fairness as systems using @select@, @epoll@, \etc. |
---|
[a44514e] | 149 | To complete the scheduler, an idle sleep mechanism is implemented that significantly reduces wasted CPU cycles, which are then available outside the application. |
---|
[86c1f1c3] | 150 | |
---|
[585d910] | 151 | \cleardoublepage |
---|
[86c1f1c3] | 152 | |
---|
[585d910] | 153 | % A C K N O W L E D G E M E N T S |
---|
| 154 | % ------------------------------- |
---|
[86c1f1c3] | 155 | |
---|
[585d910] | 156 | \begin{center}\textbf{Acknowledgements}\end{center} |
---|
| 157 | |
---|
[3f1059e] | 158 | I would like to thank my supervisor, Professor Peter Buhr, for his guidance through my degree as well as the editing of this document. |
---|
| 159 | |
---|
| 160 | I would like to thank Professors Martin Karsten and Trevor Brown, for reading my thesis and providing helpful feedback. |
---|
| 161 | |
---|
| 162 | Thanks to Andrew Beach, Michael Brooks, Colby Parsons, Mubeen Zulfiqar, Fangren Yu and Jiada Liang for their work on the \CFA project as well as all the discussions which have helped me concretize the ideas in this thesis. |
---|
| 163 | |
---|
[eb9f7f9] | 164 | Finally, I acknowledge that this has been possible thanks to the financial help offered by the David R. Cheriton School of Computer Science, the corporate partnership with Huawei Ltd. and the Natural Sciences and Engineering Research Council. |
---|
[585d910] | 165 | \cleardoublepage |
---|
| 166 | |
---|
| 167 | % D E D I C A T I O N |
---|
| 168 | % ------------------- |
---|
[86c1f1c3] | 169 | |
---|
[d835116] | 170 | % \begin{center}\textbf{Dedication}\end{center} |
---|
[86c1f1c3] | 171 | |
---|
[d835116] | 172 | % This is dedicated to the one I love. |
---|
| 173 | % \cleardoublepage |
---|
[585d910] | 174 | |
---|
| 175 | % T A B L E O F C O N T E N T S |
---|
| 176 | % --------------------------------- |
---|
| 177 | \renewcommand\contentsname{Table of Contents} |
---|
| 178 | \tableofcontents |
---|
| 179 | \cleardoublepage |
---|
| 180 | \phantomsection % allows hyperref to link to the correct page |
---|
| 181 | |
---|
| 182 | % L I S T O F F I G U R E S |
---|
| 183 | % ----------------------------- |
---|
| 184 | \addcontentsline{toc}{chapter}{List of Figures} |
---|
| 185 | \listoffigures |
---|
| 186 | \cleardoublepage |
---|
| 187 | \phantomsection % allows hyperref to link to the correct page |
---|
| 188 | |
---|
[2c63fa2] | 189 | % L I S T O F T A B L E S |
---|
| 190 | % --------------------------- |
---|
| 191 | \addcontentsline{toc}{chapter}{List of Tables} |
---|
| 192 | \listoftables |
---|
[585d910] | 193 | \cleardoublepage |
---|
| 194 | \phantomsection % allows hyperref to link to the correct page |
---|
| 195 | |
---|
[2c63fa2] | 196 | % GLOSSARIES (Lists of definitions, abbreviations, symbols, etc. provided by the glossaries-extra package) |
---|
[b9537e6] | 197 | % ----------------------------- |
---|
[5657de9] | 198 | \printglossary[type=\acronymtype,title={List of Abbreviations}] |
---|
[b9537e6] | 199 | \cleardoublepage |
---|
| 200 | \phantomsection % allows hyperref to link to the correct page |
---|
[d835116] | 201 | |
---|
[585d910] | 202 | % Change page numbering back to Arabic numerals |
---|
| 203 | \pagenumbering{arabic} |
---|
[86c1f1c3] | 204 | |
---|