This looks good. I have a few of comments:
- add read_lock_rcu() / read_unlock_rcu() around the loop in
notifier_call_chain() to be preempt-safe.
- I would suggest using struct list_head in the notifier_block
and use the RCU list routines from include/linux/list.h
instead of spreading subtle RCU memory-barrier black magic.
- Even though RCU list reading is lockless, premption needs to
be disabled while reading as mentioned above. So, we do
need an __notifier_call_chain() version for those handlers
that could sleep inside the handler: they will have to
handle the required locking themselves.
-- Vamsi Krishna S. Linux Technology Center, IBM Software Lab, Bangalore. Ph: +91 80 5044959 Internet: vamsi@in.ibm.com - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/