Re: [SisopIII-l] Re: [PATCH] fix #endif misplacement

From: Lucas Correia Villa Real
Date: Fri Nov 28 2003 - 17:31:41 EST


On Friday 28 November 2003 19:35, Ricardo Nabinger Sanchez wrote:
> Quoting Tim Schmielau <tim@xxxxxxxxxxxxxxxxxxxxxx>
> Sent on Fri, 28 Nov 2003 17:34:49 +0100 (CET)
>
> > > This patch fixes an #endif misplacement, which leads to dead code in
> > > sched_clock() in arch/i386/kernel/timers/timer_tsc.c, due to a return
> > > outside the ifdef/endif.
> >
> > No, this is exactly what is intended: don't use the TSC on NUMA, use
> > jiffies instead.
> > Look at the comment just above those lines.
>
> I'm breaking things. Sorry.
>
> I think I understood it now: the #ifndef protects only the check for TSC
> availability on non-NUMA archs. If it's available, and not under NUMA (so
> the ifndef), use it (jump to the rdtscll()), otherwise return the
> expression result.
>
> The strange thing to me is that I'm getting 1/10 of the expected value when
> measuring tasks timeslices. Instead of getting ~100ms for tasks which just
> burn CPU, I'm getting 10ms.
>
> I measure timeslices inside schedule(), updating the average timeslice for
> the leaving process, using (now - prev->timestamp).
>
> Any clue of what am I doing wrong?

Hi,

It could it be possible that TSC isn't being enabled on your processor due to
a buggy TSC. You can try to trace the code on init_tsc(), in
arch/i386/kernel/timers/timer_tsc.c to realize what's going on.

You can also try to check whether you're using HPET or not (when enabled and
supported it makes use of TSC) in your .config . In the case you're not using
it, the code that calibrates and dictates how to deal with the stamp counter
is calibrate_tsc(), in arch/i386/kernel/timers/common.c.

Hope this helps,
Lucas
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/