SlideShare a Scribd company logo
BinaryExe LLC
https://exebinary.wordpress.com/
Bottom Half in Linux Kernel
(LK)
BinaryExe LLC
https://exebinary.wordpress.com/
Bottom half
 Execute in Interrupt context after interrupt
handler (often called Top Half) complete

BinaryExe LLC
https://exebinary.wordpress.com/
Why Bottom half
 Interrupt potentially other important code
 High priory interrupt stop execution of low priority
 Worst case of IRQ_DISABLED disable all
interrupt
 Interrupt are often time critical
 Can’t be block as it is in interrupt context
BinaryExe LLC
https://exebinary.wordpress.com/
Type of Bottom half in LK 2.6
 Softirqs
 Tasklets
 Work queues
BinaryExe LLC
https://exebinary.wordpress.com/
Softirq
 Created at compile time
 Of same/different type can run
simultaneously on any
processor
 For performance critical such
networking
 Softirq doesn’t preempt other
Softirq
 Tasklets and kernel
timers built on top of
Softirq
BinaryExe LLC
https://exebinary.wordpress.com/
Softirq → Index (priority) → Description
HI_SOFTIRQ 0 Handles high priority tasklets
TIMER_SOFTIRQ 1 Tasklets related to timer interrupts
NET_TX_SOFTIRQ 2 Transmits packets to network cards
NET_RX_SOFTIRQ 3 Receives packets from network cards
SCSI_SOFTIRQ 4 Post-interrupt processing of SCSI
commands
TASKLET_SOFTIRQ 5 Handles regular tasklets
BinaryExe LLC
https://exebinary.wordpress.com/
Softirq
 Initialization
 open_softirq()
 Activation
 raise_softirq( )
 Masking
 __local_bh_disable( )/__local_bh_enable( )
 Execution
 void softirq_handler(struct softirq_action *)
BinaryExe LLC
https://exebinary.wordpress.com/
Tasklet
 Built on top of Softirqs i.e. HI_SOFTIRQ and
TASKLET_SOFTIRQ
 HI_SOFTIRQ Tasklet runs prior to TASKLET_SOFTIRQ
BinaryExe LLC
https://exebinary.wordpress.com/
Tasklet
Initialization
tasklet_init( )
Activation
tasklet_schedule( ) or asklet_hi_schedule( )
Masking
tasklet_disable( )/tasklet_enable( )
Execution
tasklet_action( )/tasklet_hi_action( )
BinaryExe LLC
https://exebinary.wordpress.com/
Softirq <-----------> Tasklet
 Only for high frequency and
highly threaded uses
 Created statically
 Simultaneous execution of
same Softirq
 For all other cases where
interrupt context is needed
 Can be created statically or
dynamically
 Two of same Tasklet can’ get
executed but two different
Tasklet can run on different
processor
 Built on top of Softirq
BinaryExe LLC
https://exebinary.wordpress.com/
Work Queues
 Defers work in kernel thread also called
worker thread
 Run in process context
 Used in case if deffered work can sleep
BinaryExe LLC
https://exebinary.wordpress.com/
Workqueue implementation
 Initialization
 create_workqueue() - creates n worker threads (n - no of
CPU)
 Activation
 queue_work( )
 Masking
BinaryExe LLC
https://exebinary.wordpress.com/
Tasklet/Softirq ←-- → Work queue
 Used when
deferred work can’t
sleep
 Not schedulable
 Used when
deferred work can
sleep
 Schedulable
BinaryExe LLC
https://exebinary.wordpress.com/
Thanks
 If there is any question, send to
exebinary@gmail.com

More Related Content

What's hot (20)

PDF
Jagan Teki - U-boot from scratch
linuxlab_conf
 
PPTX
Linux MMAP & Ioremap introduction
Gene Chang
 
PDF
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
Anne Nicolas
 
PDF
Linux Kernel - Virtual File System
Adrian Huang
 
PDF
Part 02 Linux Kernel Module Programming
Tushar B Kute
 
PDF
Arm device tree and linux device drivers
Houcheng Lin
 
PDF
What Can Compilers Do for Us?
National Cheng Kung University
 
PDF
Spi drivers
pradeep_tewani
 
PDF
Hands-on ethernet driver
SUSE Labs Taipei
 
PDF
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
National Cheng Kung University
 
PDF
GDB Rocks!
Kent Chen
 
PDF
A whirlwind tour of the LLVM optimizer
Nikita Popov
 
PDF
Linux-Internals-and-Networking
Emertxe Information Technologies Pvt Ltd
 
PDF
from Source to Binary: How GNU Toolchain Works
National Cheng Kung University
 
PDF
Embedded Linux Kernel - Build your custom kernel
Emertxe Information Technologies Pvt Ltd
 
PDF
Process Scheduler and Balancer in Linux Kernel
Haifeng Li
 
ODP
Q4.11: Porting Android to new Platforms
Linaro
 
PPTX
Linux Kernel Booting Process (1) - For NLKB
shimosawa
 
PDF
from Binary to Binary: How Qemu Works
Zhen Wei
 
PDF
Android for Embedded Linux Developers
Opersys inc.
 
Jagan Teki - U-boot from scratch
linuxlab_conf
 
Linux MMAP & Ioremap introduction
Gene Chang
 
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
Anne Nicolas
 
Linux Kernel - Virtual File System
Adrian Huang
 
Part 02 Linux Kernel Module Programming
Tushar B Kute
 
Arm device tree and linux device drivers
Houcheng Lin
 
What Can Compilers Do for Us?
National Cheng Kung University
 
Spi drivers
pradeep_tewani
 
Hands-on ethernet driver
SUSE Labs Taipei
 
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
National Cheng Kung University
 
GDB Rocks!
Kent Chen
 
A whirlwind tour of the LLVM optimizer
Nikita Popov
 
Linux-Internals-and-Networking
Emertxe Information Technologies Pvt Ltd
 
from Source to Binary: How GNU Toolchain Works
National Cheng Kung University
 
Embedded Linux Kernel - Build your custom kernel
Emertxe Information Technologies Pvt Ltd
 
Process Scheduler and Balancer in Linux Kernel
Haifeng Li
 
Q4.11: Porting Android to new Platforms
Linaro
 
Linux Kernel Booting Process (1) - For NLKB
shimosawa
 
from Binary to Binary: How Qemu Works
Zhen Wei
 
Android for Embedded Linux Developers
Opersys inc.
 

Similar to Bottom half in linux kernel (18)

PPTX
Tasklet vs work queues (Deferrable functions in linux)
RajKumar Rampelli
 
PPS
Bottom halves on Linux
Chinmay V S
 
PDF
IRQs: the Hard, the Soft, the Threaded and the Preemptible
Alison Chaiken
 
DOCX
Week 11Linux InternalsProcesses, schedulingLecture o.docx
melbruce90096
 
PDF
Solving Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Sche...
peknap
 
PDF
ECET 360 help A Guide to career/Snaptutorial
pinck2380
 
PDF
ECET 360 help A Guide to career/Snaptutorial
pinck200
 
DOCX
Ecet 360 Success Begins / snaptutorial.com
WilliamsTaylorzl
 
DOCX
Ecet 360 Enthusiastic Study / snaptutorial.com
Stephenson34
 
DOCX
Ecet 360 Massive Success / snaptutorial.com
HarrisGeorgx
 
PDF
Multithreaded Programming Part- III.pdf
Harika Pudugosula
 
PPTX
Linux Interrupts
Kernel TLV
 
PDF
Kernel Process Management
pradeep_tewani
 
PPT
Threads Advance in System Administration with Linux
Soumen Santra
 
PPTX
Linux architecture
ICI Bucharest - roTLD
 
PPTX
unit 2- process management of Operating System
leyaji3927
 
PDF
Processes
Anil Kumar Pugalia
 
PPTX
Beneath the Linux Interrupt handling
Bhoomil Chavda
 
Tasklet vs work queues (Deferrable functions in linux)
RajKumar Rampelli
 
Bottom halves on Linux
Chinmay V S
 
IRQs: the Hard, the Soft, the Threaded and the Preemptible
Alison Chaiken
 
Week 11Linux InternalsProcesses, schedulingLecture o.docx
melbruce90096
 
Solving Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Sche...
peknap
 
ECET 360 help A Guide to career/Snaptutorial
pinck2380
 
ECET 360 help A Guide to career/Snaptutorial
pinck200
 
Ecet 360 Success Begins / snaptutorial.com
WilliamsTaylorzl
 
Ecet 360 Enthusiastic Study / snaptutorial.com
Stephenson34
 
Ecet 360 Massive Success / snaptutorial.com
HarrisGeorgx
 
Multithreaded Programming Part- III.pdf
Harika Pudugosula
 
Linux Interrupts
Kernel TLV
 
Kernel Process Management
pradeep_tewani
 
Threads Advance in System Administration with Linux
Soumen Santra
 
Linux architecture
ICI Bucharest - roTLD
 
unit 2- process management of Operating System
leyaji3927
 
Beneath the Linux Interrupt handling
Bhoomil Chavda
 
Ad

Recently uploaded (20)

PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
Simplify React app login with asgardeo-sdk
vaibhav289687
 
PPTX
iaas vs paas vs saas :choosing your cloud strategy
CloudlayaTechnology
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
PPTX
Function & Procedure: Function Vs Procedure in PL/SQL
Shani Tiwari
 
PDF
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PDF
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Simplify React app login with asgardeo-sdk
vaibhav289687
 
iaas vs paas vs saas :choosing your cloud strategy
CloudlayaTechnology
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
Function & Procedure: Function Vs Procedure in PL/SQL
Shani Tiwari
 
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
Ad

Bottom half in linux kernel