From: Thomas Gleixner Subject: Re: [PATCH 1/2] hrtimer: Consider preemption when migrating hrtimer cpu_bases Date: Thu, 18 Apr 2013 11:40:32 +0200 (CEST) Message-ID: References: <1365628068-32738-1-git-send-email-mbohan@codeaurora.org> <1365628068-32738-2-git-send-email-mbohan@codeaurora.org> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Return-path: In-Reply-To: <1365628068-32738-2-git-send-email-mbohan@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org To: Michael Bohan Cc: LKML , linux-arm-msm@vger.kernel.org, Peter Zijlstra List-Id: linux-arm-msm@vger.kernel.org On Wed, 10 Apr 2013, Michael Bohan wrote: > When switching to a new cpu_base in switch_hrtimer_base(), we > briefly enable preemption by unlocking the cpu_base lock in two > places. During this interval it's possible for the running thread > to be swapped to a different CPU. > > Consider the following example: > > CPU #0 CPU #1 > ---- ---- > hrtimer_start() ... > lock_hrtimer_base() > switch_hrtimer_base() > this_cpu = 0; > target_cpu_base = 0; > raw_spin_unlock(&cpu_base->lock) > Errm. switch_hrtimer_base() is called with interrupts disabled and they stay disabled, so how exactly is the task going to be migrated? Thanks, tglx