stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Wang <wangyun@linux.vnet.ibm.com>
To: Xie XiuQi <xiexiuqi@huawei.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>,
	stable@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, 02 Jul 2013 11:20:40 +0800	[thread overview]
Message-ID: <51D24708.1060206@linux.vnet.ibm.com> (raw)
In-Reply-To: <51D16777.5000703@huawei.com>

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/
> 


  parent reply	other threads:[~2013-07-02  3:20 UTC|newest]

Thread overview: 7+ 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  3:20     ` Michael Wang [this message]
2013-07-01 15:19 ` Greg KH

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=51D24708.1060206@linux.vnet.ibm.com \
    --to=wangyun@linux.vnet.ibm.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=stable@vger.kernel.org \
    --cc=xiexiuqi@huawei.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;
as well as URLs for NNTP newsgroup(s).