SlideShare a Scribd company logo
1 of 26
EDF POLLING SERVER
Harish Chetty
Lots of Problems!
• Had to read about 20,000 Lines of Code Spread across 7 unrelated files.
• Had to read through 2000 more lines to interpret Mark’s Sporadic server!
• Understood about 20% code (which I thought was 80% at the beginning).
• Reinstalled Kernel about 500 Times.
• Found out limitations of printk’s!
• Some crash caused Disk(or something to corrupt) forcing use of TTY.
• SMP’s made life hell.
• CBS ensured PS to always fail!
• Finally the last phase was carried out on kernel which took 20 minutes to
compile.
• HAD TO FINALLY UNDERSTAND ABOUT 50% TO GET STUFF DONE!
IMAGINE A CLOCK!
Rings Bell Every 60 Seconds Period : 60 sec
Must Ring Bell for 5 Seconds Budget: 5 sec
Complete Ringing in 10 Second Deadline: 10 sec
Submit
Task
Setup
Deadline
& Budget
Enqueue
Task
Dequeue
Task
Budget Exhausted
Budget Left
When the task must end!
How much time the task should run?
?
Task
Dead
TASK COMPLETE/KILL
KILL
Wakeup task,
Run the task,
Update Runqueues etc.
Schedule task,
Block the task,
Push task in wating queue etc.
Submit
Task
Setup
Deadline (D),
Budget (B)
& Replenishment
Timer (RT)
Enqueue
Task
Dequeue
Task
B = Cap
RT Timeout
B = 0
?
Task
Dead
TASK COMPLETE/KILL
KILL
INIT
Task
Release
Replenishment
Timer (RT)
Submit
Task
Setup(D), (B)
& (RT)
Enqueue
Task
Dequeue
Task
B = (RQ TIME – START TIME)
RT Timeout
B = 0
Task
Dead
TASK COMPLETE/KILL
KILL
INIT
Task
Task
Running
Update
Status
B = Cap
B = Cap
B = 0
CPU RUNQUEUE TIME
INITIAL BUDGET
Release (RT)
Submit
Task
Setup(D), (B)
& (RT)
Enqueue
Task
Dequeue
Task
B = (RQ TIME – START TIME)
RT Timeout
B = 0
Task
Dead
TASK COMPLETE/KILL
KILL
INIT
Task
Task
Running
Update
Status
B = 0 / B = Cap
B = Cap
B = 0
Release (RT)
Submit
Task
Setup(D), (B)
& (RT)
Enqueue
Task
Dequeue
Task
B = (RQ TIME – START TIME)
RT Timeout
B = 0
Task
Dead
TASK COMPLETE/KILL
KILL
INIT
Task
Task
Running
Update
Status
B = 0 / B >= Cap
B = Cap
B = (0 + P)
OVERRUN TIME (Penalty (P))
Release (RT)
WHAT IF MORE THAN ONE TASK?
WHAT IF MORE THAN ONE TYPE OF TASK?
SCHED_OTHER
(CFS)
SCHED_RT SCHED_DEADLINE
BATCH IDLE
NORMAL EDFFIFO
ROUND
ROBIN
IDLE TASK SCHED_POLL
99 to 0132 to 100> 132 -1 -2
Submit
Task
Setup(D), (B)
& (RT)
Enqueue
Task
P = -2
Dequeue
Task
B = (RQ TIME – START TIME)
RT Timeout
B = 0
Task
Dead
TASK COMPLETE/KILL
KILL
INIT
Task
Task
Running
Update
Status
B = 0 / B >= Cap
B = Cap
B = (0 + P)
Release (RT)
Submit
Task
Setup(D), (B)
& (RT)
Enqueue
Task
P = -2
Dequeue
Task
B = (RQ TIME – START TIME)
RT Timeout
B = 0
Task
Dead
TASK COMPLETE/KILL
KILL
INIT
Task
Task
Running
Update
Status
B = 0 / B >= Cap
B = Cap
B = (0 + P)
Release (RT)
Forward
RQ TIME == Deadline!
D = D + D
Why NOT 2D ?? Here comes Periods!
WHAT IF MORE THAN ONE CPU?
Submit
Task
Setup(D), (B)
& (RT)
Enqueue
Task
P = -2
Dequeue
Task
B = (RQ TIME – START TIME)
RT Timeout
B = 0
Task
Dead
TASK COMPLETE/KILL
KILL
INIT
Task
Task
Running
Update
Status
B = 0 / B >= Cap
B = Cap
B = (0 + P)
Release (RT)
Forward
RQ TIME == Deadline!
D = D + D
SMP
Enqueue
Task
P = -2
SMP
Dequeue
Task
RT Timeout
B = 0
B = (0 + P)
N(CPU) > 1
Submit
Task
Setup(D), (B)
& (RT)
Enqueue
Task
P = -2
Dequeue
Task
B = (RQ TIME – START TIME)
RT Timeout
B = 0
Task
Dead
TASK COMPLETE/KILL
KILL
INIT
Task
Task
Running
Update
Status
B = 0 / B >= Cap
B = Cap
B = (0 + P)
Release (RT)
Forward
RQ TIME == Deadline!
D = D + D
SMP
Enqueue
Task
P = -2
SMP
Dequeue
Task
RT Timeout
B = 0
B = (0 + P)
N(CPU) > 1
Select
CPU
WHAT IF MORE THAN ONE SCHED_POLL TASK?
Submit
Task
Setup(D), (B)
& (RT)
Enqueue
Task
P = -2
Dequeue
Task
B = (RQ TIME – START TIME)
RT Timeout
B = 0
Task
Dead
TASK COMPLETE/KILL
KILL
INIT
Task
Task
Running
Update
Status
B = 0 / B >= Cap
B = Cap
B = (0 + P)
Release (RT)
Forward
RQ TIME == Deadline!
D = D + D
SMP
Enqueue
Task
P = -2
SMP
Dequeue
Task
RT Timeout
B = 0
B = (0 + P)
N(CPU) > 1
Select
CPU
Pick
Next Task
Preempt
verifier
volatile long long int count =0;
while(1){
if(count<1000000){
count++;
printf("Printing number %lld n", count);
}
else{
break;
}
}
I WILL STOP BORING YOU AND END!
EXTRAS
Data Structures
• Pick Next Tasks use RB Trees based on Deadlines.
• Leftmost Node is cached (smallest Deadline)
• CPU’s work using Max Heaps based on task deadlines.
• Root Node has CPU with a task with the largest Deadline. Preempt this first
if necessary
• Must be a Queue for more efficiency??
• Waiting Tasks use RB Trees based on Deadlines.
• Leftmost Node is cached (smallest Deadline)
Submit
Task
Setup
Deadline
& Budget
Enqueue
Task
Dequeue
Task
Budget Left = 0
Budget Left != 0
When the task must end!
How much time the task should run?
?
Wakeup task,
Run the task,
Update Runqueues etc.
Schedule task,
Block the task,
Push task in wating queue etc.
Submit
Task
Setup(D), (B)
& (RT)
Enqueue
Task
P = -2
Dequeue
Task
B = (RQ TIME – START TIME)
RT Timeout
B = 0
Task
Dead
TASK COMPLETE/KILL
KILL
INIT
Task
Task
Running
Update
Status
B = 0 / B >= Cap
B = Cap
B = (0 + P)
Release (RT)
Forward
RQ TIME == Deadline!
D = D + D
SMP
Enqueue
Task
P = -2
SMP
Dequeue
Task
RT Timeout
B = 0
B = (0 + P)
N(CPU) > 1
Select
CPU
Pick
Next Task

More Related Content

What's hot

Scheduling in Linux and Web Servers
Scheduling in Linux and Web ServersScheduling in Linux and Web Servers
Scheduling in Linux and Web ServersDavid Evans
 
Global Interpreter Lock: Episode III - cat &lt; /dev/zero > GIL;
Global Interpreter Lock: Episode III - cat &lt; /dev/zero > GIL;Global Interpreter Lock: Episode III - cat &lt; /dev/zero > GIL;
Global Interpreter Lock: Episode III - cat &lt; /dev/zero > GIL;Tzung-Bi Shih
 
Security Monitoring with eBPF
Security Monitoring with eBPFSecurity Monitoring with eBPF
Security Monitoring with eBPFAlex Maestretti
 
Computer Performance Microscopy with SHIM
Computer Performance Microscopy with SHIMComputer Performance Microscopy with SHIM
Computer Performance Microscopy with SHIMhiyangxi
 
HAB Software Woes
HAB Software WoesHAB Software Woes
HAB Software Woesjgrahamc
 
[Globant summer take over] Empowering Big Data with Cassandra
[Globant summer take over] Empowering Big Data with Cassandra[Globant summer take over] Empowering Big Data with Cassandra
[Globant summer take over] Empowering Big Data with CassandraGlobant
 
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPFLinux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPFBrendan Gregg
 
Spying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profitSpying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profitAndrea Righi
 
The Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF PrimerThe Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF PrimerSasha Goldshtein
 
Virtual Machine for Regular Expressions
Virtual Machine for Regular ExpressionsVirtual Machine for Regular Expressions
Virtual Machine for Regular ExpressionsAlexander Yakushev
 
Linux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingLinux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingKenny (netman)
 
Linux 4.x Tracing Tools: Using BPF Superpowers
Linux 4.x Tracing Tools: Using BPF SuperpowersLinux 4.x Tracing Tools: Using BPF Superpowers
Linux 4.x Tracing Tools: Using BPF SuperpowersBrendan Gregg
 
[JS EXPERIENCE 2018] Javascript Event Loop além do setInterval - Derek Stavis
[JS EXPERIENCE 2018] Javascript Event Loop além do setInterval - Derek Stavis[JS EXPERIENCE 2018] Javascript Event Loop além do setInterval - Derek Stavis
[JS EXPERIENCE 2018] Javascript Event Loop além do setInterval - Derek StavisiMasters
 
LISA17 Container Performance Analysis
LISA17 Container Performance AnalysisLISA17 Container Performance Analysis
LISA17 Container Performance AnalysisBrendan Gregg
 
IntelON 2021 Processor Benchmarking
IntelON 2021 Processor BenchmarkingIntelON 2021 Processor Benchmarking
IntelON 2021 Processor BenchmarkingBrendan Gregg
 
Staring into the eBPF Abyss
Staring into the eBPF AbyssStaring into the eBPF Abyss
Staring into the eBPF AbyssSasha Goldshtein
 
Docker at OpenDNS
Docker at OpenDNSDocker at OpenDNS
Docker at OpenDNSOpenDNS
 

What's hot (20)

Scheduling in Linux and Web Servers
Scheduling in Linux and Web ServersScheduling in Linux and Web Servers
Scheduling in Linux and Web Servers
 
Global Interpreter Lock: Episode III - cat &lt; /dev/zero > GIL;
Global Interpreter Lock: Episode III - cat &lt; /dev/zero > GIL;Global Interpreter Lock: Episode III - cat &lt; /dev/zero > GIL;
Global Interpreter Lock: Episode III - cat &lt; /dev/zero > GIL;
 
Security Monitoring with eBPF
Security Monitoring with eBPFSecurity Monitoring with eBPF
Security Monitoring with eBPF
 
Computer Performance Microscopy with SHIM
Computer Performance Microscopy with SHIMComputer Performance Microscopy with SHIM
Computer Performance Microscopy with SHIM
 
HAB Software Woes
HAB Software WoesHAB Software Woes
HAB Software Woes
 
[Globant summer take over] Empowering Big Data with Cassandra
[Globant summer take over] Empowering Big Data with Cassandra[Globant summer take over] Empowering Big Data with Cassandra
[Globant summer take over] Empowering Big Data with Cassandra
 
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPFLinux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPF
 
Ping to Pong
Ping to PongPing to Pong
Ping to Pong
 
Spying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profitSpying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profit
 
The Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF PrimerThe Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF Primer
 
Introduction to SLURM
Introduction to SLURMIntroduction to SLURM
Introduction to SLURM
 
Virtual Machine for Regular Expressions
Virtual Machine for Regular ExpressionsVirtual Machine for Regular Expressions
Virtual Machine for Regular Expressions
 
libpcap
libpcaplibpcap
libpcap
 
Linux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job SchedulingLinux fundamental - Chap 15 Job Scheduling
Linux fundamental - Chap 15 Job Scheduling
 
Linux 4.x Tracing Tools: Using BPF Superpowers
Linux 4.x Tracing Tools: Using BPF SuperpowersLinux 4.x Tracing Tools: Using BPF Superpowers
Linux 4.x Tracing Tools: Using BPF Superpowers
 
[JS EXPERIENCE 2018] Javascript Event Loop além do setInterval - Derek Stavis
[JS EXPERIENCE 2018] Javascript Event Loop além do setInterval - Derek Stavis[JS EXPERIENCE 2018] Javascript Event Loop além do setInterval - Derek Stavis
[JS EXPERIENCE 2018] Javascript Event Loop além do setInterval - Derek Stavis
 
LISA17 Container Performance Analysis
LISA17 Container Performance AnalysisLISA17 Container Performance Analysis
LISA17 Container Performance Analysis
 
IntelON 2021 Processor Benchmarking
IntelON 2021 Processor BenchmarkingIntelON 2021 Processor Benchmarking
IntelON 2021 Processor Benchmarking
 
Staring into the eBPF Abyss
Staring into the eBPF AbyssStaring into the eBPF Abyss
Staring into the eBPF Abyss
 
Docker at OpenDNS
Docker at OpenDNSDocker at OpenDNS
Docker at OpenDNS
 

Viewers also liked

Datasheet Metrel MD9240. Hubungi PT. Siwali Swantika 021-45850618
Datasheet Metrel MD9240. Hubungi PT. Siwali Swantika 021-45850618Datasheet Metrel MD9240. Hubungi PT. Siwali Swantika 021-45850618
Datasheet Metrel MD9240. Hubungi PT. Siwali Swantika 021-45850618PT. Siwali Swantika
 
державна підсумкова атестація
державна підсумкова атестаціядержавна підсумкова атестація
державна підсумкова атестаціяСергей Чабан
 
Навчання учнів розв'язуванню текстових задач
Навчання учнів розв'язуванню текстових задачНавчання учнів розв'язуванню текстових задач
Навчання учнів розв'язуванню текстових задачСергей Чабан
 
Myaware LifewithArt Winners 2016
Myaware LifewithArt Winners 2016Myaware LifewithArt Winners 2016
Myaware LifewithArt Winners 2016Chris Albas-Martin
 
Marketing Technology Stack Trends 2016
Marketing Technology Stack Trends 2016Marketing Technology Stack Trends 2016
Marketing Technology Stack Trends 2016Jesus Hoyos
 
Omni-canaliser sa relation client
Omni-canaliser sa relation clientOmni-canaliser sa relation client
Omni-canaliser sa relation clientarvato France
 
Densidad de los Agregados (Pesos Volumétricos) - Axel Martínez Nieto
Densidad de los Agregados (Pesos Volumétricos) - Axel Martínez NietoDensidad de los Agregados (Pesos Volumétricos) - Axel Martínez Nieto
Densidad de los Agregados (Pesos Volumétricos) - Axel Martínez NietoAxel Martínez Nieto
 
120 139 se ciencias sociales 3 und-6_historia de colombia
120 139 se ciencias sociales 3 und-6_historia de colombia120 139 se ciencias sociales 3 und-6_historia de colombia
120 139 se ciencias sociales 3 und-6_historia de colombiaJulian Enrique Almenares Campo
 

Viewers also liked (13)

douglas omang
douglas omangdouglas omang
douglas omang
 
Datasheet Metrel MD9240. Hubungi PT. Siwali Swantika 021-45850618
Datasheet Metrel MD9240. Hubungi PT. Siwali Swantika 021-45850618Datasheet Metrel MD9240. Hubungi PT. Siwali Swantika 021-45850618
Datasheet Metrel MD9240. Hubungi PT. Siwali Swantika 021-45850618
 
Almelo_ExtentionInteriorDesign
Almelo_ExtentionInteriorDesignAlmelo_ExtentionInteriorDesign
Almelo_ExtentionInteriorDesign
 
державна підсумкова атестація
державна підсумкова атестаціядержавна підсумкова атестація
державна підсумкова атестація
 
Навчання учнів розв'язуванню текстових задач
Навчання учнів розв'язуванню текстових задачНавчання учнів розв'язуванню текстових задач
Навчання учнів розв'язуванню текстових задач
 
GLOBAL GRADO 901
GLOBAL GRADO 901GLOBAL GRADO 901
GLOBAL GRADO 901
 
Myaware LifewithArt Winners 2016
Myaware LifewithArt Winners 2016Myaware LifewithArt Winners 2016
Myaware LifewithArt Winners 2016
 
Marketing Technology Stack Trends 2016
Marketing Technology Stack Trends 2016Marketing Technology Stack Trends 2016
Marketing Technology Stack Trends 2016
 
Genomic variation
Genomic variationGenomic variation
Genomic variation
 
Omni-canaliser sa relation client
Omni-canaliser sa relation clientOmni-canaliser sa relation client
Omni-canaliser sa relation client
 
Densidad de los Agregados (Pesos Volumétricos) - Axel Martínez Nieto
Densidad de los Agregados (Pesos Volumétricos) - Axel Martínez NietoDensidad de los Agregados (Pesos Volumétricos) - Axel Martínez Nieto
Densidad de los Agregados (Pesos Volumétricos) - Axel Martínez Nieto
 
120 139 se ciencias sociales 3 und-6_historia de colombia
120 139 se ciencias sociales 3 und-6_historia de colombia120 139 se ciencias sociales 3 und-6_historia de colombia
120 139 se ciencias sociales 3 und-6_historia de colombia
 
Jamaika - Home of Allright
Jamaika - Home of AllrightJamaika - Home of Allright
Jamaika - Home of Allright
 

Similar to Polling server

#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docxkatherncarlyle
 
Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in GolangBo-Yi Wu
 
Ssh config note
Ssh config noteSsh config note
Ssh config noteR.k. Thapa
 
9.Sorting & Searching
9.Sorting & Searching9.Sorting & Searching
9.Sorting & SearchingMandeep Singh
 
Cisco CCNA-CCNP IP SLA Configuration
Cisco CCNA-CCNP IP SLA ConfigurationCisco CCNA-CCNP IP SLA Configuration
Cisco CCNA-CCNP IP SLA ConfigurationHamed Moghaddam
 
Workshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
Workshop "Can my .NET application use less CPU / RAM?", Yevhen TatarynovWorkshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
Workshop "Can my .NET application use less CPU / RAM?", Yevhen TatarynovFwdays
 
Formal Verification of Transactional Interaction Contract
Formal Verification of Transactional Interaction ContractFormal Verification of Transactional Interaction Contract
Formal Verification of Transactional Interaction ContractGera Shegalov
 
Getting Started with Raspberry Pi - USC 2013
Getting Started with Raspberry Pi - USC 2013Getting Started with Raspberry Pi - USC 2013
Getting Started with Raspberry Pi - USC 2013Tom Paulus
 
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...Anne Nicolas
 
Patterns of parallel programming
Patterns of parallel programmingPatterns of parallel programming
Patterns of parallel programmingAlex Tumanoff
 
Getting Started with Raspberry Pi - DCC 2013.1
Getting Started with Raspberry Pi - DCC 2013.1Getting Started with Raspberry Pi - DCC 2013.1
Getting Started with Raspberry Pi - DCC 2013.1Tom Paulus
 
Operating System Lab Manual
Operating System Lab ManualOperating System Lab Manual
Operating System Lab ManualBilal Mirza
 
Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Ontico
 
GoLightly: A Go Library For Building Virtual Machines
GoLightly: A Go Library For Building Virtual MachinesGoLightly: A Go Library For Building Virtual Machines
GoLightly: A Go Library For Building Virtual MachinesEleanor McHugh
 
Capturing NIC and Kernel TX and RX Timestamps for Packets in Go
Capturing NIC and Kernel TX and RX Timestamps for Packets in GoCapturing NIC and Kernel TX and RX Timestamps for Packets in Go
Capturing NIC and Kernel TX and RX Timestamps for Packets in GoScyllaDB
 
SCHEDULING RULES DONE.pptx
SCHEDULING  RULES DONE.pptxSCHEDULING  RULES DONE.pptx
SCHEDULING RULES DONE.pptxAgnibhaBanerjee1
 
.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund
.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund
.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel ZikmundKarel Zikmund
 

Similar to Polling server (20)

Os4
Os4Os4
Os4
 
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
 
Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in Golang
 
Ssh config note
Ssh config noteSsh config note
Ssh config note
 
9.Sorting & Searching
9.Sorting & Searching9.Sorting & Searching
9.Sorting & Searching
 
Cisco CCNA-CCNP IP SLA Configuration
Cisco CCNA-CCNP IP SLA ConfigurationCisco CCNA-CCNP IP SLA Configuration
Cisco CCNA-CCNP IP SLA Configuration
 
Workshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
Workshop "Can my .NET application use less CPU / RAM?", Yevhen TatarynovWorkshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
Workshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
 
Formal Verification of Transactional Interaction Contract
Formal Verification of Transactional Interaction ContractFormal Verification of Transactional Interaction Contract
Formal Verification of Transactional Interaction Contract
 
Getting Started with Raspberry Pi - USC 2013
Getting Started with Raspberry Pi - USC 2013Getting Started with Raspberry Pi - USC 2013
Getting Started with Raspberry Pi - USC 2013
 
Process and CPU scheduler
Process and CPU schedulerProcess and CPU scheduler
Process and CPU scheduler
 
W10: Interrupts
W10: InterruptsW10: Interrupts
W10: Interrupts
 
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
 
Patterns of parallel programming
Patterns of parallel programmingPatterns of parallel programming
Patterns of parallel programming
 
Getting Started with Raspberry Pi - DCC 2013.1
Getting Started with Raspberry Pi - DCC 2013.1Getting Started with Raspberry Pi - DCC 2013.1
Getting Started with Raspberry Pi - DCC 2013.1
 
Operating System Lab Manual
Operating System Lab ManualOperating System Lab Manual
Operating System Lab Manual
 
Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)
 
GoLightly: A Go Library For Building Virtual Machines
GoLightly: A Go Library For Building Virtual MachinesGoLightly: A Go Library For Building Virtual Machines
GoLightly: A Go Library For Building Virtual Machines
 
Capturing NIC and Kernel TX and RX Timestamps for Packets in Go
Capturing NIC and Kernel TX and RX Timestamps for Packets in GoCapturing NIC and Kernel TX and RX Timestamps for Packets in Go
Capturing NIC and Kernel TX and RX Timestamps for Packets in Go
 
SCHEDULING RULES DONE.pptx
SCHEDULING  RULES DONE.pptxSCHEDULING  RULES DONE.pptx
SCHEDULING RULES DONE.pptx
 
.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund
.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund
.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund
 

Recently uploaded

Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Recently uploaded (20)

Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Polling server

  • 2. Lots of Problems! • Had to read about 20,000 Lines of Code Spread across 7 unrelated files. • Had to read through 2000 more lines to interpret Mark’s Sporadic server! • Understood about 20% code (which I thought was 80% at the beginning). • Reinstalled Kernel about 500 Times. • Found out limitations of printk’s! • Some crash caused Disk(or something to corrupt) forcing use of TTY. • SMP’s made life hell. • CBS ensured PS to always fail! • Finally the last phase was carried out on kernel which took 20 minutes to compile. • HAD TO FINALLY UNDERSTAND ABOUT 50% TO GET STUFF DONE!
  • 3. IMAGINE A CLOCK! Rings Bell Every 60 Seconds Period : 60 sec Must Ring Bell for 5 Seconds Budget: 5 sec Complete Ringing in 10 Second Deadline: 10 sec
  • 4. Submit Task Setup Deadline & Budget Enqueue Task Dequeue Task Budget Exhausted Budget Left When the task must end! How much time the task should run? ? Task Dead TASK COMPLETE/KILL KILL Wakeup task, Run the task, Update Runqueues etc. Schedule task, Block the task, Push task in wating queue etc.
  • 5. Submit Task Setup Deadline (D), Budget (B) & Replenishment Timer (RT) Enqueue Task Dequeue Task B = Cap RT Timeout B = 0 ? Task Dead TASK COMPLETE/KILL KILL INIT Task Release Replenishment Timer (RT)
  • 6. Submit Task Setup(D), (B) & (RT) Enqueue Task Dequeue Task B = (RQ TIME – START TIME) RT Timeout B = 0 Task Dead TASK COMPLETE/KILL KILL INIT Task Task Running Update Status B = Cap B = Cap B = 0 CPU RUNQUEUE TIME INITIAL BUDGET Release (RT)
  • 7. Submit Task Setup(D), (B) & (RT) Enqueue Task Dequeue Task B = (RQ TIME – START TIME) RT Timeout B = 0 Task Dead TASK COMPLETE/KILL KILL INIT Task Task Running Update Status B = 0 / B = Cap B = Cap B = 0 Release (RT)
  • 8. Submit Task Setup(D), (B) & (RT) Enqueue Task Dequeue Task B = (RQ TIME – START TIME) RT Timeout B = 0 Task Dead TASK COMPLETE/KILL KILL INIT Task Task Running Update Status B = 0 / B >= Cap B = Cap B = (0 + P) OVERRUN TIME (Penalty (P)) Release (RT)
  • 9. WHAT IF MORE THAN ONE TASK? WHAT IF MORE THAN ONE TYPE OF TASK?
  • 10. SCHED_OTHER (CFS) SCHED_RT SCHED_DEADLINE BATCH IDLE NORMAL EDFFIFO ROUND ROBIN IDLE TASK SCHED_POLL 99 to 0132 to 100> 132 -1 -2
  • 11. Submit Task Setup(D), (B) & (RT) Enqueue Task P = -2 Dequeue Task B = (RQ TIME – START TIME) RT Timeout B = 0 Task Dead TASK COMPLETE/KILL KILL INIT Task Task Running Update Status B = 0 / B >= Cap B = Cap B = (0 + P) Release (RT)
  • 12. Submit Task Setup(D), (B) & (RT) Enqueue Task P = -2 Dequeue Task B = (RQ TIME – START TIME) RT Timeout B = 0 Task Dead TASK COMPLETE/KILL KILL INIT Task Task Running Update Status B = 0 / B >= Cap B = Cap B = (0 + P) Release (RT) Forward RQ TIME == Deadline! D = D + D Why NOT 2D ?? Here comes Periods!
  • 13. WHAT IF MORE THAN ONE CPU?
  • 14. Submit Task Setup(D), (B) & (RT) Enqueue Task P = -2 Dequeue Task B = (RQ TIME – START TIME) RT Timeout B = 0 Task Dead TASK COMPLETE/KILL KILL INIT Task Task Running Update Status B = 0 / B >= Cap B = Cap B = (0 + P) Release (RT) Forward RQ TIME == Deadline! D = D + D SMP Enqueue Task P = -2 SMP Dequeue Task RT Timeout B = 0 B = (0 + P) N(CPU) > 1
  • 15. Submit Task Setup(D), (B) & (RT) Enqueue Task P = -2 Dequeue Task B = (RQ TIME – START TIME) RT Timeout B = 0 Task Dead TASK COMPLETE/KILL KILL INIT Task Task Running Update Status B = 0 / B >= Cap B = Cap B = (0 + P) Release (RT) Forward RQ TIME == Deadline! D = D + D SMP Enqueue Task P = -2 SMP Dequeue Task RT Timeout B = 0 B = (0 + P) N(CPU) > 1 Select CPU
  • 16. WHAT IF MORE THAN ONE SCHED_POLL TASK?
  • 17. Submit Task Setup(D), (B) & (RT) Enqueue Task P = -2 Dequeue Task B = (RQ TIME – START TIME) RT Timeout B = 0 Task Dead TASK COMPLETE/KILL KILL INIT Task Task Running Update Status B = 0 / B >= Cap B = Cap B = (0 + P) Release (RT) Forward RQ TIME == Deadline! D = D + D SMP Enqueue Task P = -2 SMP Dequeue Task RT Timeout B = 0 B = (0 + P) N(CPU) > 1 Select CPU Pick Next Task Preempt verifier
  • 18. volatile long long int count =0; while(1){ if(count<1000000){ count++; printf("Printing number %lld n", count); } else{ break; } }
  • 19.
  • 20.
  • 21.
  • 22. I WILL STOP BORING YOU AND END!
  • 24. Data Structures • Pick Next Tasks use RB Trees based on Deadlines. • Leftmost Node is cached (smallest Deadline) • CPU’s work using Max Heaps based on task deadlines. • Root Node has CPU with a task with the largest Deadline. Preempt this first if necessary • Must be a Queue for more efficiency?? • Waiting Tasks use RB Trees based on Deadlines. • Leftmost Node is cached (smallest Deadline)
  • 25. Submit Task Setup Deadline & Budget Enqueue Task Dequeue Task Budget Left = 0 Budget Left != 0 When the task must end! How much time the task should run? ? Wakeup task, Run the task, Update Runqueues etc. Schedule task, Block the task, Push task in wating queue etc.
  • 26. Submit Task Setup(D), (B) & (RT) Enqueue Task P = -2 Dequeue Task B = (RQ TIME – START TIME) RT Timeout B = 0 Task Dead TASK COMPLETE/KILL KILL INIT Task Task Running Update Status B = 0 / B >= Cap B = Cap B = (0 + P) Release (RT) Forward RQ TIME == Deadline! D = D + D SMP Enqueue Task P = -2 SMP Dequeue Task RT Timeout B = 0 B = (0 + P) N(CPU) > 1 Select CPU Pick Next Task