From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:37352 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031549AbdD2FPR (ORCPT ); Sat, 29 Apr 2017 01:15:17 -0400 Date: Sat, 29 Apr 2017 07:15:06 +0200 From: Greg KH To: Sebastian Andrzej Siewior Cc: stable@vger.kernel.org Subject: Re: [PATCH] cpu/hotplug: Serialize callback invocations proper Message-ID: <20170429051506.GA10014@kroah.com> References: <20170428162728.q5dpzbc2yokcdseb@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170428162728.q5dpzbc2yokcdseb@linutronix.de> Sender: stable-owner@vger.kernel.org List-ID: On Fri, Apr 28, 2017 at 06:27:28PM +0200, Sebastian Andrzej Siewior wrote: > Upstream commit dc434e056fe1dada20df7ba07f32739d3a701adf > > The setup/remove_state/instance() functions in the hotplug core code are > serialized against concurrent CPU hotplug, but unfortunately not serialized > against themself. > > As a consequence a concurrent invocation of these function results in > corruption of the callback machinery because two instances try to invoke > callbacks on remote cpus at the same time. This results in missing callback > invocations and initiator threads waiting forever on the completion. > > The obvious solution to replace get_cpu_online() with cpu_hotplug_begin() > is not possible because at least one callsite calls into these functions > from a get_online_cpu() locked region. > > Extend the protection scope of the cpuhp_state_mutex from solely protecting > the state arrays to cover the callback invocation machinery as well. > > Fixes: 5b7aa87e0482 ("cpu/hotplug: Implement setup/removal interface") > Reported-and-tested-by: Bart Van Assche > Signed-off-by: Sebastian Andrzej Siewior > Cc: hpa@zytor.com > Cc: mingo@kernel.org > Cc: akpm@linux-foundation.org > Cc: torvalds@linux-foundation.org > Link: http://lkml.kernel.org/r/20170314150645.g4tdyoszlcbajmna@linutronix.de > Signed-off-by: Thomas Gleixner > --- > kernel/cpu.c | 28 ++++++++++++++-------------- > 1 file changed, 14 insertions(+), 14 deletions(-) What stable tree(s) do you want htis patch applied to? thanks, greg k-h