From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761227AbZE1M7a (ORCPT ); Thu, 28 May 2009 08:59:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757351AbZE1M7W (ORCPT ); Thu, 28 May 2009 08:59:22 -0400 Received: from www.tglx.de ([62.245.132.106]:38191 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756839AbZE1M7V (ORCPT ); Thu, 28 May 2009 08:59:21 -0400 Date: Thu, 28 May 2009 14:53:11 +0200 (CEST) From: Thomas Gleixner To: Paul Mundt cc: Peter Zijlstra , Daniel Walker , Linus Walleij , Ingo Molnar , Andrew Victor , Haavard Skinnemoen , Andrew Morton , linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, linux-arm-kernel@lists.arm.linux.org.uk, John Stultz Subject: Re: [PATCH] sched: Support current clocksource handling in fallback sched_clock(). In-Reply-To: <20090528124207.GA28830@linux-sh.org> Message-ID: References: <1243348681.23657.14.camel@twins> <20090526230855.GA27218@linux-sh.org> <20090527001543.GA8493@linux-sh.org> <1243441525.28705.19.camel@desktop> <20090528091936.GA27545@linux-sh.org> <1243503281.23657.80.camel@twins> <20090528110902.GA27884@linux-sh.org> <20090528124207.GA28830@linux-sh.org> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) 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 On Thu, 28 May 2009, Paul Mundt wrote: > On Thu, May 28, 2009 at 02:22:17PM +0200, Thomas Gleixner wrote: > > On Thu, 28 May 2009, Paul Mundt wrote: > > > @@ -437,10 +441,19 @@ void clocksource_unregister(struct clocksource *cs) > > > unsigned long flags; > > > > > > spin_lock_irqsave(&clocksource_lock, flags); > > > + > > > + if (sched_clocksource == cs) { > > > + printk(KERN_WARNING "Refusing to unregister " > > > + "scheduler clocksource %s", cs->name); > > > > Hmm, isn't that dangerous ? The clocksource might be in a module or > > in kmalloced memory which is going to be freed. > > > Perhaps the saner thing to do is see if select_clocksource() manages to > find something suitable, otherwise switch back to jiffies.. That makes sense. The scheduler should be able handle that, if not ... :) Thanks, tglx