Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932309AbXLNLFa (ORCPT ); Fri, 14 Dec 2007 06:05:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754749AbXLNLFV (ORCPT ); Fri, 14 Dec 2007 06:05:21 -0500 Received: from www.tglx.de ([62.245.132.106]:55656 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752014AbXLNLFU (ORCPT ); Fri, 14 Dec 2007 06:05:20 -0500 Date: Fri, 14 Dec 2007 12:05:03 +0100 (CET) From: Thomas Gleixner To: Andi Kleen cc: miaox@cn.fujitsu.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] time: add an offline-cpu check in add_timer_on() In-Reply-To: Message-ID: References: <47625B94.50105@cn.fujitsu.com> User-Agent: Alpine 0.99999 (LFD 796 2007-11-08) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1089 Lines: 29 On Fri, 14 Dec 2007, Andi Kleen wrote: > Miao Xie writes: > > > Hi everyone, > > I think we need a check in the function add_timer_on() to avoid adding a > > timer into the timer list of an offline cpu. > > > > This patch fixes this problem in add_timer_on(). > > No it doesn't -- it will just crash if a caller does that. If it's a real > problem then you either need to fix the callers or change add_timer_on() > to transparently put it onto another CPU. > > I don't think it's a real problem though because CPU offlining does > a stop machine and that should take care of most such races. No. CPU offlining does not prevent code to try inserting a timer on a offlined CPU. If there is a real problem with this we need to fix the calling code. We should not insert it somewhere else magically. Thanks, tglx -- 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/