From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH]CPUFREQ: Fix two racing issues during cpu hotplug Date: Mon, 12 Apr 2010 07:59:36 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Wei, Gang" , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 12/04/2010 07:54, "Wei, Gang" wrote: >> Can't you just kill_timer()? Adding extra code into a stop_machine >> context is dangerous: e.g., >> xmalloc()->alloc_xenheap_pages()->memguard_unguard_range()->map_pages_to_xen >> ()->flush_area_all() results in deadlock as other cpus are spinning >> with irqs disabled. > > You are right. kill_timer stop timer and wait until timer handler end if this > timer is current running. I can switch to it. BTW, I may need to re-init the > killed timer before set_timer on it, right? Yes, init_timer() must be called to be able to reuse a kill_timer()ed timer. -- Keir