From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754976Ab1IGOCK (ORCPT ); Wed, 7 Sep 2011 10:02:10 -0400 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:59012 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754273Ab1IGOCH (ORCPT ); Wed, 7 Sep 2011 10:02:07 -0400 Date: Wed, 7 Sep 2011 15:01:30 +0100 From: Russell King - ARM Linux To: Thomas Gleixner Cc: Frank Rowand , "paulmck@linux.vnet.ibm.com" , "Rowand, Frank" , Peter Zijlstra , linux-kernel , linux-rt-users , Mike Galbraith , Ingo Molnar , Venkatesh Pallipadi Subject: Re: [ANNOUNCE] 3.0.1-rt11 Message-ID: <20110907140130.GT6619@n2100.arm.linux.org.uk> References: <1313232790.25267.7.camel@twins> <4E559039.8060209@am.sony.com> <20110826235507.GJ2342@linux.vnet.ibm.com> <4E66DCAB.8090801@am.sony.com> <20110907104633.GR6619@n2100.arm.linux.org.uk> <20110907104747.GA29282@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 07, 2011 at 12:57:44PM +0200, Thomas Gleixner wrote: > The problem is that if you enable interrupts on the CPU _BEFORE_ it is > set online AND active, then you can end up waking up kernel threads > which are bound to that CPU and the scheduler will happily schedule > them on an online CPU. That makes them lose the cpu affinity to the > CPU as well and hell breaks lose. How can that happen? 1. The only interrupts we're likely to receive are the local timer interrupts - we have not routed any other interrupts to this CPU. 2. We will not schedule on this CPU except at explicit scheduling points (such as contended mutexes or explicit calls to schedule) as we have a call to preempt_disable(). > Frank has observed this with softirq threads, but the same thing is > true for any other CPU bound thread like the worker stuff. So who is scheduling a workqueue from the local timer? > So moving the online, active thing BEFORE enabling interrupt is the > only sensible solution. Yes, that'll be why even x86 enables interrupts before setting the CPU online for the delay calibration.