• Neil Brown's avatar
    [PATCH] Convert cpu hotplug notifiers to use raw_notifier instead of blocking_notifier · bd5349cf
    Neil Brown authored
    The use of blocking notifier by _cpu_up and _cpu_down in cpu.c has two
    problem.
    
    1/ An interaction with the workqueue notifier causes lockdep to spit a
       warning.
    
    2/ A notifier could conceivable be added or removed while _cpu_up or
       _cpu_down are in process.  As each notifier is called twice (prepare
       then commit/abort) this could be unhealthy.
    
    To fix to we simply take cpu_add_remove_lock while adding or removing
    notifiers to/from the list.
    
    This makes the 'blocking' usage unnecessary as all accesses to cpu_chain
    are now protected by cpu_add_remove_lock.  So change "blocking" to "raw" in
    all relevant places.  This fixes 1.
    
    Credit: Andrew Morton
    Cc: Rusty Russell <rusty@rustcorp.com.au>
    Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com> (reporter)
    Signed-off-by: default avatarNeil Brown <neilb@suse.de>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    bd5349cf
cpu.c 7.17 KB