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

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central BankingThe Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central BankingSelcen Ozturkcan
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central BankingThe Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central Banking
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

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