Re: [PATCH] N1int for interactivity

Mike Galbraith (efault@gmx.de)
Tue, 15 Jul 2003 09:02:20 +0200


At 02:03 PM 7/15/2003 +1000, Con Kolivas wrote:
>On Tue, 15 Jul 2003 13:59, Andrew Morton wrote:
> > Con Kolivas <kernel@kolivas.org> wrote:
> > > I've modified Mike Galbraith's nanosleep work for greater resolution to
> > > help the interactivity estimator work I've done in the O*int patches.

(I think a repeat of an earlier public warning wrt this diff may be in
order: run irman/contest before you proceed... here there be giant economy
sized dragons)

> > >
> > > +inline void __scheduler_tick(runqueue_t *rq, task_t *p)
> >
> > Two callsites, this guy shouldn't be inlined.

(I just wild-guessed that it'd be a tiny bit faster while i was coding...
_the_ fast-path and all)

> >
> > Should it have static scope? The code as-is generates a third copy...
> >
> > > static unsigned long long monotonic_clock_tsc(void)
> > > {
> > > unsigned long long last_offset, this_offset, base;
> > > -
> > > + unsigned long flags;
> > > +
> > > /* atomically read monotonic base & last_offset */
> > > - read_lock_irq(&monotonic_lock);
> > > + read_lock_irqsave(&monotonic_lock, flags);
> > > last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
> > > base = monotonic_base;
> > > - read_unlock_irq(&monotonic_lock);
> > > + read_unlock_irqrestore(&monotonic_lock, flags);
> > >
> > > /* Read the Time Stamp Counter */
> >
> > Why do we need to take a global lock here? Can't we use
> > get_cycles() or something?

The scalability issue is gone I'm told.

> Have all the other architectures been reviewed to see if they need this
> > change?
>
>I'm calling for help here. This is getting way out of my depth; I've simply
>applied Mike's patch.

Everyone will likely need that, or there will be major explosions. You'll
also have to deal with the no-tsc case... either return jiffies * 1000000
or make it a config option.

(I'd go with a config option if I were you...dragons aren't all that likely
to torch a desktop load, but if you do this globally, I'm quite certain
that something is going to get char-broiled;)

-Mike

-
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/