Please sign in to comment.
CPU hotplug, debug: detect imbalance between get_online_cpus() and pu…
…t_online_cpus() The synchronization between CPU hotplug readers and writers is achieved by means of refcounting, safeguarded by the cpu_hotplug.lock. get_online_cpus() increments the refcount, whereas put_online_cpus() decrements it. If we ever hit an imbalance between the two, we end up compromising the guarantees of the hotplug synchronization i.e, for example, an extra call to put_online_cpus() can end up allowing a hotplug reader to execute concurrently with a hotplug writer. So, add a WARN_ON() in put_online_cpus() to detect such cases where the refcount can go negative, and also attempt to fix it up, so that we can continue to run. Signed-off-by: Srivatsa S. Bhat <email@example.com> Reviewed-by: Yasuaki Ishimatsu <firstname.lastname@example.org> Cc: Jiri Kosina <email@example.com> Cc: Thomas Gleixner <firstname.lastname@example.org> Cc: Ingo Molnar <email@example.com> Cc: Peter Zijlstra <firstname.lastname@example.org> Signed-off-by: Andrew Morton <email@example.com> Signed-off-by: Linus Torvalds <firstname.lastname@example.org>
- Loading branch information...