Re: Needed faster implementation of do_gettimeofday()

From: George Anzinger
Date: Mon Feb 21 2005 - 22:09:17 EST


Parag Warudkar wrote:
On Sunday 20 February 2005 05:58 am, puneet_kaushik@xxxxxxxxxxxxxxxx wrote:

985913 8.6083 vmlinux mark_offset_tsc
584473 5.1032 libc-2.3.2.so getc


What makes you think mark_offset_tsc is slow? Do you have any comparative numbers? It might just be that the workload you are throwing at it justifies it. (For e.g. if your workload does a zillion system calls, system_call will show up as a hot spot in oprofile - doesn't necessarily mean it is slow - it's just overused.) Can you post the relevant code?

He really is right. Mark offset is reading the PIT counter and that is not only rather dumb but dog slow.

A suggestion, try the high res timers patch. Even if you don't use the timers the mark offset there is MUCH faster. It does not read the PIT.

The difference is where we assume the jiffie bump is in time. If we assume it is at the point that the PIT interrupts, well then the only way to get to that is to read the PIT. If, on the other hand, we assume it is at the time after the interrrupt where we mark offset, we can observe the "best" time for this event based on the TSC and avoid reading the PIT.

Try the HRT patch (see signature below) and see if if doesn't do better.


--
George Anzinger george@xxxxxxxxxx
High-res-timers: http://sourceforge.net/projects/high-res-timers/

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