Re: New time code miscalculates cpu usage
Hello. Benjamin Herrenschmidt wrote: Not sure when this started happening, but I wanted to report it. I'll start bisecting in a day or two if noone else has gotten around to looking at it: $ echo int main(void) { while(1); } test.c ; gcc test.c $ time ./a.out sleep 2 ; killall a.out real0m2.008s user0m4.014s sys 0m0.002s Seen on POWER5 and PA6T, haven't tried anything else yet. I'm not surprised -- the kernel accounts twice for each tick. Your input would be much more valuable if you actually pointed out where that happens and why since you seem to know it. I've already pointed out the reason, yet it won't hurt to repeat indeed. timer_interrupt() calls both account_process_time() and the hrtimers event handler which leads to: - if determenistic accounting is off, account_process_time() is the same as update_process_times() which gets also calleed by hrtimers via the event handler, so we get each tick accounted for twice; - if determenistic accounting is on, then timer_interrupt() calls account_process_time() and update_process_times() is still called by hrtimers, so each tick's gets accounted for userspace twice... Ben. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: New time code miscalculates cpu usage
On Wed, Oct 17, 2007 at 04:07:48PM +1000, Tony Breeds wrote: On Tue, Oct 16, 2007 at 03:25:25PM -0500, Olof Johansson wrote: Hi, Not sure when this started happening, but I wanted to report it. I'll start bisecting in a day or two if noone else has gotten around to looking at it: $ echo int main(void) { while(1); } test.c ; gcc test.c $ time ./a.out sleep 2 ; killall a.out real0m2.008s user0m4.014s sys 0m0.002s Seen on POWER5 and PA6T, haven't tried anything else yet. For what it's worth, this is my bug. I suspected it, and git bisect confirmed it.I have an ugly work around now, but hope to have something better out tomorrow. Hi Tony, Any news? -Olof ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: New time code miscalculates cpu usage
Hello. Olof Johansson wrote: Not sure when this started happening, but I wanted to report it. I'll start bisecting in a day or two if noone else has gotten around to looking at it: $ echo int main(void) { while(1); } test.c ; gcc test.c $ time ./a.out sleep 2 ; killall a.out real0m2.008s user0m4.014s sys 0m0.002s Seen on POWER5 and PA6T, haven't tried anything else yet. I'm not surprised -- the kernel accounts twice for each tick. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: New time code miscalculates cpu usage
On Thu, 2007-10-25 at 00:17 +0400, Sergei Shtylyov wrote: Hello. Olof Johansson wrote: Not sure when this started happening, but I wanted to report it. I'll start bisecting in a day or two if noone else has gotten around to looking at it: $ echo int main(void) { while(1); } test.c ; gcc test.c $ time ./a.out sleep 2 ; killall a.out real0m2.008s user0m4.014s sys 0m0.002s Seen on POWER5 and PA6T, haven't tried anything else yet. I'm not surprised -- the kernel accounts twice for each tick. Your input would be much more valuable if you actually pointed out where that happens and why since you seem to know it. Ben. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: New time code miscalculates cpu usage
Benjamin Herrenschmidt writes: Your input would be much more valuable if you actually pointed out where that happens and why since you seem to know it. He did already, a couple of messages ago. Paul. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: New time code miscalculates cpu usage
On Thu, 2007-10-25 at 10:19 +1000, Paul Mackerras wrote: Benjamin Herrenschmidt writes: Your input would be much more valuable if you actually pointed out where that happens and why since you seem to know it. He did already, a couple of messages ago. Allright, I missed that. Ben. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: New time code miscalculates cpu usage
On Tue, Oct 16, 2007 at 03:25:25PM -0500, Olof Johansson wrote: Hi, Not sure when this started happening, but I wanted to report it. I'll start bisecting in a day or two if noone else has gotten around to looking at it: $ echo int main(void) { while(1); } test.c ; gcc test.c $ time ./a.out sleep 2 ; killall a.out real0m2.008s user0m4.014s sys 0m0.002s Seen on POWER5 and PA6T, haven't tried anything else yet. For what it's worth, this is my bug. I suspected it, and git bisect confirmed it.I have an ugly work around now, but hope to have something better out tomorrow. Thanks Olof. Yours Tony linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/ Jan 28 - Feb 02 2008 The Australian Linux Technical Conference! ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
New time code miscalculates cpu usage
Hi, Not sure when this started happening, but I wanted to report it. I'll start bisecting in a day or two if noone else has gotten around to looking at it: $ echo int main(void) { while(1); } test.c ; gcc test.c $ time ./a.out sleep 2 ; killall a.out real0m2.008s user0m4.014s sys 0m0.002s Seen on POWER5 and PA6T, haven't tried anything else yet. -Olof ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev