From: Mike Galbraith <bitbucket@online.de>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: Re: dynticks: CONFIG_VIRT_CPU_ACCOUNTING + CONFIG_CONTEXT_TRACKING breaks accounting on core2 CPUs only
Date: Tue, 14 May 2013 09:37:19 +0200 [thread overview]
Message-ID: <1368517039.5885.3.camel@marge.simpson.net> (raw)
In-Reply-To: <20130514005744.GA12749@somewhere>
On Tue, 2013-05-14 at 02:57 +0200, Frederic Weisbecker wrote:
> On Sun, May 12, 2013 at 10:17:49AM +0200, Mike Galbraith wrote:
> > Greetings,
> >
> > Turning on new NO_HZ feature on my Q6600 box in master, I see that tasks
> > accrue zero utime/stime. However, the same exact kernel on E5620 box
> > works fine, so it would appear there's a CPU dependency somewhere.
>
> Ah indeed, I just managed to reproduce the same issue.
>
> >
> > Is core2 expected to go dysfunctional with context tracking enabled?
> > CONFIG_VIRT_CPU_ACCOUNTING alone works fine in 3.9-stable, turn on
> > CONFIG_CONTEXT_TRACKING_FORCE, and CPU accounting stops working on core2
> > boxen only, same exact kernel continues to work just fine on E5620
> > (Westmere) box.
>
> There was no known issue with core2. The box where I'm seeing the it
> is a Phenom quad core that had NR_CPUS=2. May be the issue is more
> likely to happen with this low number. I don't know.
>
> I'm investigating further.
Me too.
bash-6023 [001] d... 290.494214: vtime_delta: clock: 289702961236 vtime_snap: 290493017701
Always. Not good.
I see..
current->vtime_snap = sched_clock();
and..
clock = local_clock();
Things that make ya go hmm. The below "fixes" it (not).
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index cc2dc3ee..3133665 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -634,14 +634,17 @@ void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime
#endif /* !CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
-static unsigned long long vtime_delta(struct task_struct *tsk)
+static noinline unsigned long long vtime_delta(struct task_struct *tsk)
{
unsigned long long clock;
- clock = local_clock();
+// clock = local_clock();
+ clock = sched_clock();
+ trace_printk("clock: %Lu vtime_snap: %Lu\n", clock, tsk->vtime_snap);
if (clock < tsk->vtime_snap)
return 0;
+ trace_printk("clock: %Lu vtime_snap: %Lu returns :%Lu\n", clock, tsk->vtime_snap, clock - tsk->vtime_snap);
return clock - tsk->vtime_snap;
}
next prev parent reply other threads:[~2013-05-14 7:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-12 8:17 Mike Galbraith
2013-05-14 0:57 ` Frederic Weisbecker
2013-05-14 7:37 ` Mike Galbraith [this message]
2013-05-14 14:07 ` Mike Galbraith
2013-05-15 0:26 ` Frederic Weisbecker
2013-05-15 4:09 ` Mike Galbraith
2013-05-15 16:05 ` Frederic Weisbecker
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=1368517039.5885.3.camel@marge.simpson.net \
--to=bitbucket@online.de \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@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
Powered by JetHome