Return-Path: Message-ID: <51D24708.1060206@linux.vnet.ibm.com> Date: Tue, 02 Jul 2013 11:20:40 +0800 From: Michael Wang MIME-Version: 1.0 To: Xie XiuQi CC: Mike Galbraith , Peter Zijlstra , Ingo Molnar , "linux-kernel@vger.kernel.org" , stable@vger.kernel.org, Li Zefan , Zhang Hang , Li Bin Subject: Re: [PATCH] sched: fix cpu utilization account error References: <51D12570.9070100@huawei.com> <1372664187.7678.45.camel@marge.simpson.net> <51D16777.5000703@huawei.com> In-Reply-To: <51D16777.5000703@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: 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; > schedule(); > } > > /* get data and sent it */ > get_msg(); > send_msg(); What about use cond_resched() here? Isn't that more gentle? Regards, Michael Wang > > if (kthread_should_stop()) > break; > } > >> That said, accounting funnies induced by skipped update are possible, >> which could trump the cycle savings I suppose, so maybe savings (sniff) >> should just go away? > > Indeed, removing the skip_clock_update could resolve the issue, but I found > there is no this issue in preempt mode. However, if remove skip_clock_update > we'll get more precise time account. > > So, what's your opinion, Mike. > > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ >