From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Gleixner Subject: Re: migrate_disable() race with cpu hotplug? Date: Wed, 27 Jul 2011 23:52:18 +0200 (CEST) Message-ID: References: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: LKML , linux-rt-users , Peter Zijlstra , Ingo Molnar To: Yong Zhang Return-path: Received: from www.linutronix.de ([62.245.132.108]:36121 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755882Ab1G0VwU (ORCPT ); Wed, 27 Jul 2011 17:52:20 -0400 In-Reply-To: Sender: linux-rt-users-owner@vger.kernel.org List-ID: On Tue, 26 Jul 2011, Yong Zhang wrote: > When reading the code, I'm afraid there is a race between migrate_disable() > and cpu hotplug. A scenario will like below: > > CPU0 CPU1 > _cpu_down(); > cpu_unplug_begin(); > wait_for_completion() > sync_unplug_thread(); > complete(); > race_window? /* > * migrate_disable() will > * not take effect since > * hotplug is in progress > */ Rightfully so. The caller will just block on the cpu_hotplug.lock mutex until the unplug operation will be done. Thanks, tglx