Tuesday, August 31, 2021

Kernel helpers

 

  • Top Half : It is part of the kernel which handles the ISR request . Should be light weight and schedule a job with the bottom half.
  • Bottom half : It does the deferred job processing
  • softIRQ & Tasklet are almost same but tasklet can be dynamically created and destroyed
  • kthread and workqueue is almost same, but workqueue has many small work which can be excecuted, thread is a single work unit   
  • workqueue runs in process context ( this i can not wrap my head )
    • it gets created during the driver initialization process
    • a work is pushed to the work queue
    • how will process know which work queue to invoke
    • IOCTL will push a request to the driver and get a job done  

 

  •     link
    • https://linux-kernel-labs.github.io/refs/heads/master/labs/infrastructure.html
    • https://www.oreilly.com/library/view/understanding-the-linux/0596005652/ch04s08.html 
    • https://stackoverflow.com/questions/23094444/difference-b-w-kthread-and-work-queues
    • https://lwn.net/Articles/392783/