From: Sefer T. <se...@ho...> - 2003-04-09 07:18:16
|
Indeed, you were both correct. I am running it on a laptop (compaq armada m300) with apm enabled. I must admit that this proves to be quite an annoyance, since I do most of my work on a laptop. Does that affect the timing of other functions as well? I'm unfailiar with these high resolution time counters in x86, but it strikes me odd that Intel wouldn't provide an equivilant, reliable mechanism for laptops as well (maybe in exchange of accuracy or slight performance impact). I'm curious, is there any way around this? Thanks in advance, Sefer. >From: Julian Seward <js...@ac...> >To: Jeremy Fitzhardinge <je...@go...>, Sefer Tov <se...@ho...> >CC: val...@li... >Subject: Re: [Valgrind-users] Scheduler problem >Date: Tue, 8 Apr 2003 21:24:24 +0000 > > >Sefer, > >I tested the program you sent me (below) and it behaves >identically running on V from normal; no timing anomalies. >This is running on a 1133Mhz PIII-T (desktop) machine. > >I suspect Jeremy may be right about the power management thing; >he's had a patch available for that for a while. Can you >clarify the situation re power management on your platform? >Thanks. > >J > >#include <pthread.h> >#include <stdio.h> >#include <unistd.h> > > >void *start(void *p) >{ > printf("Hi!\n"); > sleep(1); > printf("Here\n"); > sleep(1); > > return 0; >} > > >int main() >{ > pthread_t tid; > void *p; > int i; > > for ( i = 0; i < 5; ++i ) { > pthread_create(&tid, 0, start, 0); > } > pthread_join(tid, &p); > > return 0; >} > >On Tuesday 08 April 2003 10:12 am, Jeremy Fitzhardinge wrote: > > Quoting Sefer Tov <se...@ho...>: > > > Hi! > > > > > > I've been testing a short threaded program, and I noticed that >sleep(x), > > > > > > although utilizes no cpu, it schdules poorly (the program slows down > > > almost > > > to a halt). > > > > Is your machine a laptop, or a desktop with power management enabled? > > Valgrind uses the TSC register as its timebase, and I've noticed on my > > laptop the TSC doesn't advance when the machine is idle. You can easily > > tell if this is the case: if you run a CPU-bound program at the same >time, > > then the TSC advances at near full speed and the sleeps are for the >right > > time. > > > > J > _________________________________________________________________ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail |
From: Julian S. <js...@ac...> - 2003-04-09 07:45:22
|
On Wednesday 09 April 2003 7:17 am, Sefer Tov wrote: > Indeed, you were both correct. > I am running it on a laptop (compaq armada m300) with apm enabled. > > I must admit that this proves to be quite an annoyance, since I do most of > my work on a laptop. Does that affect the timing of other functions as > well? > > I'm unfailiar with these high resolution time counters in x86, but it > strikes me odd that Intel wouldn't provide an equivilant, reliable > mechanism for laptops as well (maybe in exchange of accuracy or slight > performance impact). > > I'm curious, is there any way around this? Try the patch called 09-rdtsc-calibration from http://www.goop.org/~jeremy/valgrind/ J > > Thanks in advance, > Sefer. > > > From: Julian Seward <js...@ac...> > > >To: Jeremy Fitzhardinge <je...@go...>, Sefer Tov <se...@ho...> > >CC: val...@li... > >Subject: Re: [Valgrind-users] Scheduler problem > >Date: Tue, 8 Apr 2003 21:24:24 +0000 > > > > > >Sefer, > > > >I tested the program you sent me (below) and it behaves > >identically running on V from normal; no timing anomalies. > >This is running on a 1133Mhz PIII-T (desktop) machine. > > > >I suspect Jeremy may be right about the power management thing; > >he's had a patch available for that for a while. Can you > >clarify the situation re power management on your platform? > >Thanks. > > > >J > > > >#include <pthread.h> > >#include <stdio.h> > >#include <unistd.h> > > > > > >void *start(void *p) > >{ > > printf("Hi!\n"); > > sleep(1); > > printf("Here\n"); > > sleep(1); > > > > return 0; > >} > > > > > >int main() > >{ > > pthread_t tid; > > void *p; > > int i; > > > > for ( i = 0; i < 5; ++i ) { > > pthread_create(&tid, 0, start, 0); > > } > > pthread_join(tid, &p); > > > > return 0; > >} > > > >On Tuesday 08 April 2003 10:12 am, Jeremy Fitzhardinge wrote: > > > Quoting Sefer Tov <se...@ho...>: > > > > Hi! > > > > > > > > I've been testing a short threaded program, and I noticed that > > > >sleep(x), > > > > > > although utilizes no cpu, it schdules poorly (the program slows down > > > > almost > > > > to a halt). > > > > > > Is your machine a laptop, or a desktop with power management enabled? > > > Valgrind uses the TSC register as its timebase, and I've noticed on my > > > laptop the TSC doesn't advance when the machine is idle. You can > > > easily tell if this is the case: if you run a CPU-bound program at the > > > same > > > >time, > > > > > then the TSC advances at near full speed and the sleeps are for the > > > >right > > > > > time. > > > > > > J > > _________________________________________________________________ > Add photos to your messages with MSN 8. Get 2 months FREE*. > http://join.msn.com/?page=features/featuredemail |
From: Jeremy F. <je...@go...> - 2003-04-09 23:13:26
|
Quoting Julian Seward <js...@ac...>: > Try the patch called 09-rdtsc-calibration from > http://www.goop.org/~jeremy/valgrind/ I doubt that will help much - that just stops an assertion failure when getting the calibration. The basic problem is that the TSC is variable-rate, and therefore useless as a timebase. J |
From: Sebastian K. <Seb...@so...> - 2003-04-10 15:26:12
|
At first (this is my first post here), hello to everyone, especially developers -- thanks for creating such great tool (it puts some commercial $$$ stuff, I was once using, to shame -- V is more powerful, more feature rich, and on text console is much more useable, than the other $tuff was with gui) ----- Original Message ----- From: "Jeremy Fitzhardinge" <je...@go...> > Quoting Julian Seward <js...@ac...>: > > > Try the patch called 09-rdtsc-calibration from > > http://www.goop.org/~jeremy/valgrind/ > > I doubt that will help much - that just stops an assertion failure when getting > the calibration. The basic problem is that the TSC is variable-rate, and > therefore useless as a timebase. Well, using TSC for counting time is not *The Right Thing(tm)*. Is it impossible to use some other measurement instead (at best OS provided)? What are the issues? rgds Sebastian Kaliszewski |