Re: [PATCH] Notifier for significant events on i386

From: Vamsi Krishna S . (vamsi@in.ibm.com)
Date: Thu Dec 12 2002 - 02:34:06 EST


On Thu, Dec 12, 2002 at 12:25:47AM +0000, Stephen Hemminger wrote:
>
> This patch changes notifier to use RCU. No interface change, just a little
> more memory in each notifier_block. Also some formatting cleanup.
> Please review and give comments.
>
> <snip patch>

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/



This archive was generated by hypermail 2b29 : Sun Dec 15 2002 - 22:00:24 EST