Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-26 Thread Olivier Langlois
> > > I did vary HZ from 300 to 1000 HZ, I tried the 3 three different > preemption models. > > With all these combinations, I still have the problem. > Actually, I may have observed more failure with 1000 HZ and CONFIG_PREEMPT=y (low-latency desktop) Also make sure that High resolution

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-26 Thread Olivier Langlois
> > > Also other factors to consider it is are you doing the test on a very > loaded system? What is your platform? > > I have tested it positively on 32 bit, 64 bits build on Atom N450 > > i7 first and second generation system. > > I did vary HZ from 300 to 1000 HZ, I tried the 3 three

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-26 Thread Olivier Langlois
> 2) tst-cputimer1.c only have CLOCK_PROCESS_CPUTIME_ID test and > don't have any utime, stime tests. > Sorry, I should take a couple minutes break before pressing send to be sure that I have said everything :-) CLOCK_PROCESS_CPUTIME_ID is user space name for kernel space CPUCLOCK_SCHED clock.

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-26 Thread Olivier Langlois
On Fri, 2013-04-26 at 22:15 -0400, KOSAKI Motohiro wrote: > On Fri, Apr 26, 2013 at 9:51 PM, Olivier Langlois > wrote: > > On Fri, 2013-04-26 at 15:08 -0400, KOSAKI Motohiro wrote: > >> > I need to add that I can only confirm that to be true with > >> > sum_exec_runtime. > >> > > >> > To affirm

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-26 Thread KOSAKI Motohiro
On Fri, Apr 26, 2013 at 9:51 PM, Olivier Langlois wrote: > On Fri, 2013-04-26 at 15:08 -0400, KOSAKI Motohiro wrote: >> > I need to add that I can only confirm that to be true with >> > sum_exec_runtime. >> > >> > To affirm it to be true for stime and utime would require more >> > investigation.

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-26 Thread Olivier Langlois
On Fri, 2013-04-26 at 15:08 -0400, KOSAKI Motohiro wrote: > > I need to add that I can only confirm that to be true with > > sum_exec_runtime. > > > > To affirm it to be true for stime and utime would require more > > investigation. I didn't look them at all. I was only concerned with > >

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-26 Thread KOSAKI Motohiro
> I need to add that I can only confirm that to be true with > sum_exec_runtime. > > To affirm it to be true for stime and utime would require more > investigation. I didn't look them at all. I was only concerned with > sum_exec_runtime. > > I will prepare a v2 of the patch accounting all the

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-26 Thread Olivier Langlois
On Fri, 2013-04-26 at 00:40 -0400, Olivier Langlois wrote: > On Fri, 2013-04-19 at 11:08 -0700, KOSAKI Motohiro wrote: > > On Fri, Apr 19, 2013 at 10:38 AM, KOSAKI Motohiro > > wrote: > > >> I feel we are hitting the same issue than this patch: > > >> https://lkml.org/lkml/2013/4/5/116 > > >> > >

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-26 Thread Olivier Langlois
On Fri, 2013-04-26 at 00:40 -0400, Olivier Langlois wrote: On Fri, 2013-04-19 at 11:08 -0700, KOSAKI Motohiro wrote: On Fri, Apr 19, 2013 at 10:38 AM, KOSAKI Motohiro kosaki.motoh...@gmail.com wrote: I feel we are hitting the same issue than this patch:

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-26 Thread KOSAKI Motohiro
I need to add that I can only confirm that to be true with sum_exec_runtime. To affirm it to be true for stime and utime would require more investigation. I didn't look them at all. I was only concerned with sum_exec_runtime. I will prepare a v2 of the patch accounting all the feedbacks

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-26 Thread Olivier Langlois
On Fri, 2013-04-26 at 15:08 -0400, KOSAKI Motohiro wrote: I need to add that I can only confirm that to be true with sum_exec_runtime. To affirm it to be true for stime and utime would require more investigation. I didn't look them at all. I was only concerned with sum_exec_runtime.

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-26 Thread KOSAKI Motohiro
On Fri, Apr 26, 2013 at 9:51 PM, Olivier Langlois oliv...@trillion01.com wrote: On Fri, 2013-04-26 at 15:08 -0400, KOSAKI Motohiro wrote: I need to add that I can only confirm that to be true with sum_exec_runtime. To affirm it to be true for stime and utime would require more

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-26 Thread Olivier Langlois
On Fri, 2013-04-26 at 22:15 -0400, KOSAKI Motohiro wrote: On Fri, Apr 26, 2013 at 9:51 PM, Olivier Langlois oliv...@trillion01.com wrote: On Fri, 2013-04-26 at 15:08 -0400, KOSAKI Motohiro wrote: I need to add that I can only confirm that to be true with sum_exec_runtime. To affirm

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-26 Thread Olivier Langlois
2) tst-cputimer1.c only have CLOCK_PROCESS_CPUTIME_ID test and don't have any utime, stime tests. Sorry, I should take a couple minutes break before pressing send to be sure that I have said everything :-) CLOCK_PROCESS_CPUTIME_ID is user space name for kernel space CPUCLOCK_SCHED clock.

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-26 Thread Olivier Langlois
Also other factors to consider it is are you doing the test on a very loaded system? What is your platform? I have tested it positively on 32 bit, 64 bits build on Atom N450 i7 first and second generation system. I did vary HZ from 300 to 1000 HZ, I tried the 3 three different

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-26 Thread Olivier Langlois
I did vary HZ from 300 to 1000 HZ, I tried the 3 three different preemption models. With all these combinations, I still have the problem. Actually, I may have observed more failure with 1000 HZ and CONFIG_PREEMPT=y (low-latency desktop) Also make sure that High resolution timers

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-25 Thread Olivier Langlois
On Fri, 2013-04-19 at 11:08 -0700, KOSAKI Motohiro wrote: > On Fri, Apr 19, 2013 at 10:38 AM, KOSAKI Motohiro > wrote: > >> I feel we are hitting the same issue than this patch: > >> https://lkml.org/lkml/2013/4/5/116 > >> > >> I'm adding Kosaki in Cc, who proposed roughly the same fix. > > > >

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-25 Thread Olivier Langlois
On Fri, 2013-04-19 at 11:08 -0700, KOSAKI Motohiro wrote: On Fri, Apr 19, 2013 at 10:38 AM, KOSAKI Motohiro kosaki.motoh...@gmail.com wrote: I feel we are hitting the same issue than this patch: https://lkml.org/lkml/2013/4/5/116 I'm adding Kosaki in Cc, who proposed roughly the same

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-19 Thread KOSAKI Motohiro
On Fri, Apr 19, 2013 at 10:38 AM, KOSAKI Motohiro wrote: >> I feel we are hitting the same issue than this patch: >> https://lkml.org/lkml/2013/4/5/116 >> >> I'm adding Kosaki in Cc, who proposed roughly the same fix. > > Thanks to CCing. I'm now sitting LSF and I can't read whole tons emails. >

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-19 Thread KOSAKI Motohiro
> I feel we are hitting the same issue than this patch: > https://lkml.org/lkml/2013/4/5/116 > > I'm adding Kosaki in Cc, who proposed roughly the same fix. Thanks to CCing. I'm now sitting LSF and I can't read whole tons emails. However the fix is definitely same and I definitely agree this

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-19 Thread Frederic Weisbecker
2013/4/12 Peter Zijlstra : > On Fri, 2013-04-12 at 12:50 +0200, Peter Zijlstra wrote: > >> I'll try and dig through the rest of your email later.. sorry for >> being >> a tad slow etc. > > > So at thread_group_cputimer() we initialize the cputimer->cputime state > by using thread_group_cputime()

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-19 Thread Frederic Weisbecker
2013/4/12 Peter Zijlstra pet...@infradead.org: On Fri, 2013-04-12 at 12:50 +0200, Peter Zijlstra wrote: I'll try and dig through the rest of your email later.. sorry for being a tad slow etc. So at thread_group_cputimer() we initialize the cputimer-cputime state by using

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-19 Thread KOSAKI Motohiro
I feel we are hitting the same issue than this patch: https://lkml.org/lkml/2013/4/5/116 I'm adding Kosaki in Cc, who proposed roughly the same fix. Thanks to CCing. I'm now sitting LSF and I can't read whole tons emails. However the fix is definitely same and I definitely agree this

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-19 Thread KOSAKI Motohiro
On Fri, Apr 19, 2013 at 10:38 AM, KOSAKI Motohiro kosaki.motoh...@gmail.com wrote: I feel we are hitting the same issue than this patch: https://lkml.org/lkml/2013/4/5/116 I'm adding Kosaki in Cc, who proposed roughly the same fix. Thanks to CCing. I'm now sitting LSF and I can't read whole

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-15 Thread Olivier Langlois
On Fri, 2013-04-12 at 17:55 +0200, Peter Zijlstra wrote: > On Fri, 2013-04-12 at 12:50 +0200, Peter Zijlstra wrote: > > > I'll try and dig through the rest of your email later.. sorry for > > being > > a tad slow etc. > > > So at thread_group_cputimer() we initialize the cputimer->cputime

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-15 Thread Olivier Langlois
On Fri, 2013-04-12 at 17:55 +0200, Peter Zijlstra wrote: On Fri, 2013-04-12 at 12:50 +0200, Peter Zijlstra wrote: I'll try and dig through the rest of your email later.. sorry for being a tad slow etc. So at thread_group_cputimer() we initialize the cputimer-cputime state by using

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-14 Thread Olivier Langlois
On Fri, 2013-04-12 at 11:16 +0200, Peter Zijlstra wrote: > On Wed, 2013-04-10 at 11:48 -0400, Olivier Langlois wrote: > > Please explain how expensive it is. All I am seeing is a couple of > > additions. > > Let me start with this, since your earlier argument also refers to > this. > > So yes it

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-14 Thread Olivier Langlois
On Fri, 2013-04-12 at 11:16 +0200, Peter Zijlstra wrote: On Wed, 2013-04-10 at 11:48 -0400, Olivier Langlois wrote: Please explain how expensive it is. All I am seeing is a couple of additions. Let me start with this, since your earlier argument also refers to this. So yes it does look

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-12 Thread Peter Zijlstra
On Fri, 2013-04-12 at 12:50 +0200, Peter Zijlstra wrote: > I'll try and dig through the rest of your email later.. sorry for > being > a tad slow etc. So at thread_group_cputimer() we initialize the cputimer->cputime state by using thread_group_cputime() which iterates all tasks of the process

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-12 Thread Peter Zijlstra
On Wed, 2013-04-10 at 11:48 -0400, Olivier Langlois wrote: > > You have valid concerns and I will attempt to clarify the changes I > propose. Before I do, realise that as a first time patcher, I > sincerely > attempted to minimize the changes required to fix the posix cputimers. Right, I suspect

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-12 Thread Peter Zijlstra
On Wed, 2013-04-10 at 11:48 -0400, Olivier Langlois wrote: > If it is important to stop it then the code will require a fix anyway. > > 1. > As you could start it > indefinitely with 0 timers if calling posix_cpu_timer_set() does not > end > up arming a timer or > > 2. > > Having one periodic

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-12 Thread Peter Zijlstra
On Wed, 2013-04-10 at 11:48 -0400, Olivier Langlois wrote: > Please explain how expensive it is. All I am seeing is a couple of > additions. Let me start with this, since your earlier argument also refers to this. So yes it does look simple and straight fwd, only one addition. However its an

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-12 Thread Peter Zijlstra
On Wed, 2013-04-10 at 11:48 -0400, Olivier Langlois wrote: Please explain how expensive it is. All I am seeing is a couple of additions. Let me start with this, since your earlier argument also refers to this. So yes it does look simple and straight fwd, only one addition. However its an

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-12 Thread Peter Zijlstra
On Wed, 2013-04-10 at 11:48 -0400, Olivier Langlois wrote: If it is important to stop it then the code will require a fix anyway. 1. As you could start it indefinitely with 0 timers if calling posix_cpu_timer_set() does not end up arming a timer or 2. Having one periodic timer. The

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-12 Thread Peter Zijlstra
On Wed, 2013-04-10 at 11:48 -0400, Olivier Langlois wrote: You have valid concerns and I will attempt to clarify the changes I propose. Before I do, realise that as a first time patcher, I sincerely attempted to minimize the changes required to fix the posix cputimers. Right, I suspect some

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-12 Thread Peter Zijlstra
On Fri, 2013-04-12 at 12:50 +0200, Peter Zijlstra wrote: I'll try and dig through the rest of your email later.. sorry for being a tad slow etc. So at thread_group_cputimer() we initialize the cputimer-cputime state by using thread_group_cputime() which iterates all tasks of the process and

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-10 Thread Olivier Langlois
On Wed, 2013-04-10 at 13:35 +0200, Peter Zijlstra wrote: > On Fri, 2013-04-05 at 13:59 -0400, Olivier Langlois wrote: > > Process timers are moving fasters than their corresponding > > cpu clock for various reasons: > > > > 1. There is a race condition when getting a timer sample that makes the

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-10 Thread Olivier Langlois
On Wed, 2013-04-10 at 13:35 +0200, Peter Zijlstra wrote: > On Fri, 2013-04-05 at 13:59 -0400, Olivier Langlois wrote: > > Process timers are moving fasters than their corresponding > > cpu clock for various reasons: > > > > 1. There is a race condition when getting a timer sample that makes the

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-10 Thread Peter Zijlstra
On Fri, 2013-04-05 at 13:59 -0400, Olivier Langlois wrote: > Process timers are moving fasters than their corresponding > cpu clock for various reasons: > > 1. There is a race condition when getting a timer sample that makes the sample >be smaller than it should leading to setting the timer

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-10 Thread Peter Zijlstra
On Fri, 2013-04-05 at 13:59 -0400, Olivier Langlois wrote: Process timers are moving fasters than their corresponding cpu clock for various reasons: 1. There is a race condition when getting a timer sample that makes the sample be smaller than it should leading to setting the timer

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-10 Thread Olivier Langlois
On Wed, 2013-04-10 at 13:35 +0200, Peter Zijlstra wrote: On Fri, 2013-04-05 at 13:59 -0400, Olivier Langlois wrote: Process timers are moving fasters than their corresponding cpu clock for various reasons: 1. There is a race condition when getting a timer sample that makes the sample

Re: [PATCH] process cputimer is moving faster than its corresponding clock

2013-04-10 Thread Olivier Langlois
On Wed, 2013-04-10 at 13:35 +0200, Peter Zijlstra wrote: On Fri, 2013-04-05 at 13:59 -0400, Olivier Langlois wrote: Process timers are moving fasters than their corresponding cpu clock for various reasons: 1. There is a race condition when getting a timer sample that makes the sample

[PATCH] process cputimer is moving faster than its corresponding clock

2013-04-05 Thread Olivier Langlois
Process timers are moving fasters than their corresponding cpu clock for various reasons: 1. There is a race condition when getting a timer sample that makes the sample be smaller than it should leading to setting the timer expiration to soon. 2. When initializing the cputimer, by including

[PATCH] process cputimer is moving faster than its corresponding clock

2013-04-05 Thread Olivier Langlois
Process timers are moving fasters than their corresponding cpu clock for various reasons: 1. There is a race condition when getting a timer sample that makes the sample be smaller than it should leading to setting the timer expiration to soon. 2. When initializing the cputimer, by including