Re: [PATCH] sched: fix cpu utilization account error

2013-07-01 Thread Xie XiuQi
On 2013/7/2 11:20, Michael Wang wrote: > Hi, Xie > > On 07/01/2013 07:26 PM, Xie XiuQi wrote: > [snip] >> Here is the kthread main logic. Although it's not a good idea, but it does >> exist: >> while (!kthread_should_stop()) { >> /* call schedule every 1 sec */ >> if (HZ <= jiffies - las

Re: [PATCH] sched: fix cpu utilization account error

2013-07-01 Thread Xie XiuQi
On 2013/7/2 11:07, Mike Galbraith wrote: > On Mon, 2013-07-01 at 19:26 +0800, Xie XiuQi wrote: > >> Here is the kthread main logic. Although it's not a good idea, but it does >> exist: > > Why not fix this instead? > >> while (!kthread_should_stop()) { >> /* call schedule every 1 sec */ >>

Re: [PATCH] sched: fix cpu utilization account error

2013-07-01 Thread Michael Wang
Hi, Xie On 07/01/2013 07:26 PM, Xie XiuQi wrote: [snip] > Here is the kthread main logic. Although it's not a good idea, but it does > exist: > while (!kthread_should_stop()) { > /* call schedule every 1 sec */ > if (HZ <= jiffies - last) { > last = jiffies; >

Re: [PATCH] sched: fix cpu utilization account error

2013-07-01 Thread Mike Galbraith
On Mon, 2013-07-01 at 19:26 +0800, Xie XiuQi wrote: > Here is the kthread main logic. Although it's not a good idea, but it does > exist: Why not fix this instead? > while (!kthread_should_stop()) { > /* call schedule every 1 sec */ > if (HZ <= jiffies - last) { > last

Re: [PATCH] sched: fix cpu utilization account error

2013-07-01 Thread Xie XiuQi
On 2013/7/1 23:19, Greg KH wrote: > On Mon, Jul 01, 2013 at 02:45:04PM +0800, Xie XiuQi wrote: >> We setting clock_skip_update = 1 based on the assumption that the >> next call to update_rq_clock() will come nearly immediately >> after being set. However, it is not always true especially on >> non-

Re: [PATCH] sched: fix cpu utilization account error

2013-07-01 Thread Greg KH
On Mon, Jul 01, 2013 at 02:45:04PM +0800, Xie XiuQi wrote: > We setting clock_skip_update = 1 based on the assumption that the > next call to update_rq_clock() will come nearly immediately > after being set. However, it is not always true especially on > non-preempt mode. In this case we may miss s

Re: [PATCH] sched: fix cpu utilization account error

2013-07-01 Thread Mike Galbraith
On Mon, 2013-07-01 at 19:26 +0800, Xie XiuQi wrote: > On 2013/7/1 15:36, Mike Galbraith wrote: > > On Mon, 2013-07-01 at 14:45 +0800, Xie XiuQi wrote: > >> We setting clock_skip_update = 1 based on the assumption that the > >> next call to update_rq_clock() will come nearly immediately > >> after

Re: [PATCH] sched: fix cpu utilization account error

2013-07-01 Thread Xie XiuQi
On 2013/7/1 15:36, Mike Galbraith wrote: > On Mon, 2013-07-01 at 14:45 +0800, Xie XiuQi wrote: >> We setting clock_skip_update = 1 based on the assumption that the >> next call to update_rq_clock() will come nearly immediately >> after being set. However, it is not always true especially on >> non

Re: [PATCH] sched: fix cpu utilization account error

2013-07-01 Thread Mike Galbraith
On Mon, 2013-07-01 at 14:45 +0800, Xie XiuQi wrote: > We setting clock_skip_update = 1 based on the assumption that the > next call to update_rq_clock() will come nearly immediately > after being set. However, it is not always true especially on > non-preempt mode. In this case we may miss some cl