public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Xie XiuQi <xiexiuqi@huawei.com>
To: Michael Wang <wangyun@linux.vnet.ibm.com>
Cc: Mike Galbraith <efault@gmx.de>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@elte.hu>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Li Zefan <lizefan@huawei.com>,
	Zhang Hang <bob.zhanghang@huawei.com>,
	Li Bin <huawei.libin@huawei.com>
Subject: Re: [PATCH] sched: fix cpu utilization account error
Date: Tue, 2 Jul 2013 12:15:06 +0800	[thread overview]
Message-ID: <51D253CA.5080204@huawei.com> (raw)
In-Reply-To: <51D24708.1060206@linux.vnet.ibm.com>

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 - last) {
>> 		last = jiffies;
>> 		schedule();
>> 	}
>>
>> 	/* get data and sent it */
>> 	get_msg();
>> 	send_msg();
> 
> What about use cond_resched() here? Isn't that more gentle?
> 

That's a good idea for driver implementation.
Thank you Michael.

> Regards,
> Michael Wang
> 



  reply	other threads:[~2013-07-02  4:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-01  6:45 [PATCH] sched: fix cpu utilization account error Xie XiuQi
2013-07-01  7:36 ` Mike Galbraith
2013-07-01 11:26   ` Xie XiuQi
2013-07-01 11:43     ` Mike Galbraith
2013-07-02  3:07     ` Mike Galbraith
2013-07-02  4:11       ` Xie XiuQi
2013-07-02  3:20     ` Michael Wang
2013-07-02  4:15       ` Xie XiuQi [this message]
2013-07-01 15:19 ` Greg KH
2013-07-02  1:41   ` Xie XiuQi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51D253CA.5080204@huawei.com \
    --to=xiexiuqi@huawei.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=bob.zhanghang@huawei.com \
    --cc=efault@gmx.de \
    --cc=huawei.libin@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mingo@elte.hu \
    --cc=wangyun@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox