cpu: Avoid puts_pending overflow
A long string of get_online_cpus() with each followed by a put_online_cpu() that fails to acquire cpu_hotplug.lock can result in overflow of the cpu_hotplug.puts_pending counter. Although this is perhaps improbably, a system with absolutely no CPU-hotplug operations will have an arbitrarily long time in which this overflow could occur. This commit therefore adds overflow checks to get_online_cpus() and try_get_online_cpus(). Change-Id: Iaac6c81b4cc34946a9769f1a3b4aa39fa3eb8ef3 Signed-off-by:Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by:
Pranith Kumar <bobby.prani@gmail.com> Git-commit: 62db99f4783ea34531fc344bd8c539d5d186f24d Git-repo: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git Signed-off-by:
Mahesh Sivasubramanian <msivasub@codeaurora.org>
Loading
Please register or sign in to comment