Return-Path: Message-ID: <1372734474.7363.66.camel@marge.simpson.net> Subject: Re: [PATCH] sched: fix cpu utilization account error From: Mike Galbraith To: Xie XiuQi Cc: Peter Zijlstra , Ingo Molnar , "linux-kernel@vger.kernel.org" , stable@vger.kernel.org, Li Zefan , Zhang Hang , Li Bin Date: Tue, 02 Jul 2013 05:07:54 +0200 In-Reply-To: <51D16777.5000703@huawei.com> References: <51D12570.9070100@huawei.com> <1372664187.7678.45.camel@marge.simpson.net> <51D16777.5000703@huawei.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: 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 = jiffies; > schedule(); > } Hanging out in the kernel for ages is not cool. That doesn't mean something else might not pop up that forces the issue, but to date it has not, and sacrificing precious fastpath cycles is not attractive. -Mike