Re: [PATCH] sched: Support current clocksource handling in fallback

Thomas Gleixner
2009-05-28T12:53:11Z

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