lkml.org 
[lkml]   [2017]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tick/nohz: Fix wrong user and system time accouting against vtime sampling
On Wed, 5 Apr 2017, Wanpeng Li wrote:
> + /*
> + * Offset the tick to avert jiffies_lock contention, and all ticks
> + * alignment in order that the vtime sampling does not end up "in
> + * phase" with the jiffies incrementing.
> + */
> + if (sched_skew_tick || tick_nohz_full_enabled()) {
> u64 offset = ktime_to_ns(tick_period) >> 1;
> do_div(offset, num_possible_cpus());
> offset *= smp_processor_id();

That's not a fix, that's just papering over the problem.

offset = 1ms / 2 = 500us = 500000ns;
offset /= 144 = 3472ns

So CPU0 and CPU1 ticks are ~3 microseconds apart. That merily reduces the
probability of the issue, but does not prevent it.

Thanks,

tglx

\
 
 \ /
  Last update: 2017-04-10 17:47    [W:0.096 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site