linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* inconsistent do_gettimeofday for copy_page
@ 2004-03-10 11:19 Ashwin Rao
  2004-03-10 11:35 ` Benjamin Herrenschmidt
  2004-03-10 12:21 ` Richard B. Johnson
  0 siblings, 2 replies; 3+ messages in thread
From: Ashwin Rao @ 2004-03-10 11:19 UTC (permalink / raw)
  To: linux-kernel, linux-mm

For calculating the time required to copy_page i tried
the do_gettimeofday for 1000 pages in a loop. But as
the number of pages changes the time required varies
non-linearly.
I also tried reading xtime and using monotonic_clock
but they didnt help either. For do_gettimeof day for a
single invocation of copy_page on a pentium 4 gave me
10 microsecs but when invoked for a 1000 pages the
time required was 750ns per page.
Is there some way of finding out the exact time
required for copying a page.

Ashwin

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you?re looking for faster
http://search.yahoo.com
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: inconsistent do_gettimeofday for copy_page
  2004-03-10 11:19 inconsistent do_gettimeofday for copy_page Ashwin Rao
@ 2004-03-10 11:35 ` Benjamin Herrenschmidt
  2004-03-10 12:21 ` Richard B. Johnson
  1 sibling, 0 replies; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2004-03-10 11:35 UTC (permalink / raw)
  To: Ashwin Rao; +Cc: Linux Kernel list, linux-mm

On Wed, 2004-03-10 at 22:19, Ashwin Rao wrote:
> For calculating the time required to copy_page i tried
> the do_gettimeofday for 1000 pages in a loop. But as
> the number of pages changes the time required varies
> non-linearly.

That's expected, unless you have no cache ;) Then you also
have the TLB misses..

> I also tried reading xtime and using monotonic_clock
> but they didnt help either. For do_gettimeof day for a
> single invocation of copy_page on a pentium 4 gave me
> 10 microsecs but when invoked for a 1000 pages the
> time required was 750ns per page.
> Is there some way of finding out the exact time
> required for copying a page.

No. It depends mostly on cache effects and bus usage, though
you can probably get good approximation for both the cases
where everything is in the cache on both sides of the copy,
and when you are in the worst case scenario of cold cache
or larger copy than the cache.

Ben.


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: inconsistent do_gettimeofday for copy_page
  2004-03-10 11:19 inconsistent do_gettimeofday for copy_page Ashwin Rao
  2004-03-10 11:35 ` Benjamin Herrenschmidt
@ 2004-03-10 12:21 ` Richard B. Johnson
  1 sibling, 0 replies; 3+ messages in thread
From: Richard B. Johnson @ 2004-03-10 12:21 UTC (permalink / raw)
  To: Ashwin Rao; +Cc: linux-kernel, linux-mm

On Wed, 10 Mar 2004, Ashwin Rao wrote:

> For calculating the time required to copy_page i tried
> the do_gettimeofday for 1000 pages in a loop. But as
> the number of pages changes the time required varies
> non-linearly.
> I also tried reading xtime and using monotonic_clock
> but they didnt help either. For do_gettimeof day for a
> single invocation of copy_page on a pentium 4 gave me
> 10 microsecs but when invoked for a 1000 pages the
> time required was 750ns per page.
> Is there some way of finding out the exact time
> required for copying a page.
>
> Ashwin
>

`rdtsc` on Intel. Gets total CPU clocks. Of course, you will
get jitter unless you disable interrupts during the procedure
you are measuring.


Cheers,
Dick Johnson
Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips).
            Note 96.31% of all statistics are fiction.


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-03-10 12:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-10 11:19 inconsistent do_gettimeofday for copy_page Ashwin Rao
2004-03-10 11:35 ` Benjamin Herrenschmidt
2004-03-10 12:21 ` Richard B. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox