Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752020AbbBRDLt (ORCPT ); Tue, 17 Feb 2015 22:11:49 -0500 Received: from e31.co.us.ibm.com ([32.97.110.149]:46027 "EHLO e31.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751701AbbBRDLs (ORCPT ); Tue, 17 Feb 2015 22:11:48 -0500 Message-ID: <54E402BC.2010709@linux.vnet.ibm.com> Date: Wed, 18 Feb 2015 08:40:52 +0530 From: Preeti U Murthy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Peter Zijlstra CC: linux-kernel@vger.kernel.org, mingo@kernel.org, rjw@rjwysocki.net, tglx@linutronix.de Subject: Re: [PATCH 32/35] clockevents: Fix cpu down race for hrtimer based broadcasting References: <20150216121435.203983131@infradead.org> <20150216122413.880378334@infradead.org> <54E2BDA1.3040003@linux.vnet.ibm.com> <20150217103946.GD21418@twins.programming.kicks-ass.net> In-Reply-To: <20150217103946.GD21418@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15021803-8236-0000-0000-000009865802 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1549 Lines: 40 On 02/17/2015 04:09 PM, Peter Zijlstra wrote: >> [PATCH 11/35] clockevents: Cleanup dead cpu explicitely n Tue, Feb 17, 2015 at 09:33:45AM +0530, Preeti U Murthy wrote: >> On 02/16/2015 05:45 PM, Peter Zijlstra wrote: >> >>>> From: Thomas Gleixner >> >>>> @@ -428,7 +428,7 @@ static int __ref _cpu_down(unsigned int >>>> __cpu_die(cpu); >>>> >>>> /* CPU is completely dead: tell everyone. Too late to complain. */ >>>> - tick_cleanup_dead_cpu(cpu); >>>> + tick_takeover(cpu); >> >> Why is tick_handover() called after __cpu_die()? > See: [PATCH 11/35] clockevents: Cleanup dead cpu explicitely > it used to be a CPU_DEAD notifier. > But, I think, the actual reason would be that you cannot be sure its not > still ticking until its actually proper dead and buried, so trying to > take over a tick from a cpu that's still ticking is... well, suspect. Look at the changelog, it explains why tick_takeover must be called *before* __cpu_die(). The above hunk is not solving the issue, it is equivalent to the scenario where we took over broadcast duty in the CPU_DEAD phase as a consequence of which the cpu doing the hotplug operation is stuck sleeping forever. Cleanup functions can be handled after __cpu_die() for the reason that you mention above. Regards Preeti U Murthy -- 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/