Notification Chains in Linux Kernel

notification chains in linux kernel n.w
1 / 8
Embed
Share

Dive into the world of notification chains in the Linux kernel. Learn how to handle asynchronous inter-module communication and explore different types and APIs involved in this mechanism.

  • Linux Kernel
  • Notification Chains
  • Inter-module Communication
  • Asynchronous Communication

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Notification Chains inLinux Kernel Nuclear Geeks (Aman Mehta)

  2. Quick intro Notification Chains in kernel is a way to handle asynchronous inter module communication with in kernel space. Types are - Click here Quick Steps: Initialize the head of chain with these APIs. Register the chain of functions to the initialized head (APIs), the idea is whenever the event of call chains are executed all the function chain registered to the head will be called. When these set of APIs are called the event to trigger the call chain kicks in. Based on these return calls the behaviors of chain is worked out. Never to forget - on exit of modules unregister from the chains (APTs).

  3. Initialized Head Block Diagram Initialize Head API Add a Notifier Block Reg API Function_Ptrs() Trigger Call chain APIs blocking_notifier_chain_register() Trigger Head to execute all functions in the chain

  4. Types of Notification Chains Atomic : For very inportant stuff Blocking : For notification purpose Raw : For our own way of trigerring them SRCU : Sleepable Read Copy Update. RCU based implementations Read More @ https://thenucleargeeks.com/2019/09/21/some-notes-on-notification-chain-linux-kernel/

  5. Head Initializer Types Atomic : ATOMIC_NOTIFIER_HEAD(name_of_head) Blocking : BLOCKING_NOTIFIER_HEAD(name_of_head) Raw : RAW_NOTIFIER_HEAD(name_of_head) SRCU : SRCU_NOTIFIER_HEAD(name_of_head)

  6. Register APIs Name suggests most of it: extern int atomic_notifier_chain_register(struct atomic_notifier_head *nh, struct notifier_block *nb); extern int blocking_notifier_chain_register(struct blocking_notifier_head *nh, struct notifier_block *nb); extern int raw_notifier_chain_register(struct raw_notifier_head *nh, struct notifier_block *nb); extern int srcu_notifier_chain_register(struct srcu_notifier_head *nh, struct notifier_block *nb);

  7. Call Chain APIs -Trigger Events Name suggests most of it: extern int atomic_notifier_chain_register(struct atomic_notifier_head *nh, struct notifier_block *nb); extern int atomic_notifier_call_chain(struct atomic_notifier_head *nh, unsigned long val, void *v); extern int blocking_notifier_call_chain(struct blocking_notifier_head *nh, unsigned long val, void *v); extern int raw_notifier_call_chain(struct raw_notifier_head *nh, unsigned long val, void *v); extern int srcu_notifier_call_chain(struct srcu_notifier_head *nh, unsigned long val, void *v);

  8. Unregister APIs Name suggests most of it: extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *nh, struct notifier_block *nb); extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *nh, struct notifier_block *nb); extern int raw_notifier_chain_unregister(struct raw_notifier_head *nh, struct notifier_block *nb); extern int srcu_notifier_chain_unregister(struct srcu_notifier_head *nh, struct notifier_block *nb);

More Related Content