Frederic Weisbecker
2b17c545a4
nohz: Fix one jiffy count too far in idle cputime
...
When we stop the tick in idle, we save the current jiffies value
in ts->idle_jiffies. This snapshot is substracted from the later
value of jiffies when the tick is restarted and the resulting
delta is accounted as idle cputime. This is how we handle the
idle cputime accounting without the tick.
But sometimes we need to schedule the next tick to some time in
the future instead of completely stopping it. In this case, a
tick may happen before we restart the periodic behaviour and
from that tick we account one jiffy to idle cputime as usual but
we also increment the ts->idle_jiffies snapshot by one so that
when we compute the delta to account, we substract the one jiffy
we just accounted.
To prepare for stopping the tick outside idle, we introduced a
check that prevents from fixing up that ts->idle_jiffies if we
are not running the idle task. But we use idle_cpu() for that
and this is a problem if we run the tick while another CPU
remotely enqueues a ttwu to our runqueue:
CPU 0: CPU 1:
tick_sched_timer() { ttwu_queue_remote()
if (idle_cpu(CPU 0))
ts->idle_jiffies++;
}
Here, idle_cpu() notes that &rq->wake_list is not empty and
hence won't consider the CPU as idle. As a result,
ts->idle_jiffies won't be incremented. But this is wrong because
we actually account the current jiffy to idle cputime. And that
jiffy won't get substracted from the nohz time delta. So in the
end, this jiffy is accounted twice.
Fix this by changing idle_cpu(smp_processor_id()) with
is_idle_task(current). This way the jiffy is substracted
correctly even if a ttwu operation is enqueued on the CPU.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: <stable@vger.kernel.org> # 3.5+
Link: http://lkml.kernel.org/r/1349308004-3482-1-git-send-email-fweisbec@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2012-10-05 10:22:20 +02:00
..
debug
kernel/debug: Make use of KGDB_REASON_NMI
2012-07-31 08:16:43 -05:00
events
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2012-10-01 10:28:49 -07:00
gcov
irq
genirq: Export dummy_irq_chip
2012-08-21 16:14:23 +02:00
power
Revert "NMI watchdog: fix for lockup detector breakage on resume"
2012-08-08 20:49:45 +02:00
sched
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2012-10-01 10:43:39 -07:00
time
nohz: Fix one jiffy count too far in idle cputime
2012-10-05 10:22:20 +02:00
trace
trace: Move trace event enable from fs_initcall to core_initcall
2012-09-24 14:13:02 -04:00
.gitignore
acct.c
async.c
[SCSI] async: make async_synchronize_full() flush all work regardless of domain
2012-07-20 09:07:37 +01:00
audit.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
2012-08-01 10:26:23 -07:00
audit.h
audit_tree.c
audit: clean up refcounting in audit-tree
2012-08-15 12:55:22 +02:00
audit_watch.c
get rid of kern_path_parent()
2012-07-14 16:35:02 +04:00
auditfilter.c
audit: allow interfield comparison in audit rules
2012-01-17 16:17:01 -05:00
auditsc.c
seccomp: remove duplicated failure logging
2012-04-14 11:13:20 +10:00
backtracetest.c
bounds.c
capability.c
userns: Teach inode_capable to understand inodes whose uids map to other namespaces.
2012-05-15 14:59:24 -07:00
cgroup.c
Merge branch 'for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
2012-07-24 17:47:44 -07:00
cgroup_freezer.c
cgroup: convert all non-memcg controllers to the new cftype interface
2012-04-01 12:09:55 -07:00
compat.c
new helper: sigsuspend()
2012-05-21 23:52:30 -04:00
configs.c
cpu.c
Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2012-10-01 10:46:27 -07:00
cpu_pm.c
kernel/cpu_pm.c: fix various typos
2012-05-31 17:49:27 -07:00
cpuset.c
cpusets: Remove/update outdated comments
2012-07-24 13:53:28 +02:00
crash_dump.c
cred.c
keys: kill task_struct->replacement_session_keyring
2012-05-23 22:11:41 -04:00
delayacct.c
dma.c
Remove all #inclusions of asm/system.h
2012-03-28 18:30:03 +01:00
elfcore.c
exec_domain.c
exit.c
posix_types.h: Cleanup stale __NFDBITS and related definitions
2012-07-26 13:36:43 -07:00
extable.c
extable: Skip sorting if sorted at build time.
2012-04-19 15:06:55 -07:00
fork.c
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2012-10-01 10:43:39 -07:00
freezer.c
PM / Freezer: Remove references to TIF_FREEZE in comments
2012-03-04 23:08:54 +01:00
futex.c
futex: Forbid uaddr == uaddr2 in futex_wait_requeue_pi()
2012-07-24 16:02:57 +02:00
futex_compat.c
futex: Mark get_robust_list as deprecated
2012-03-29 11:37:17 +02:00
groups.c
userns: Convert in_group_p and in_egroup_p to use kgid_t
2012-05-03 03:29:33 -07:00
hrtimer.c
hrtimer: Update hrtimer base offsets each hrtimer_interrupt
2012-07-11 23:34:39 +02:00
hung_task.c
hung task debugging: Inject NMI when hung and going to panic
2012-04-25 12:39:25 +02:00
irq_work.c
irq_work: fix compile failure on tile from missing include
2012-04-13 13:15:16 -04:00
itimer.c
itimer: Use printk_once instead of WARN_ONCE
2012-04-10 11:00:30 +02:00
jump_label.c
static keys: Inline the static_key_enabled() function
2012-02-28 20:01:08 +01:00
kallsyms.c
vsprintf: fix %ps on non symbols when using kallsyms
2012-05-29 16:22:32 -07:00
kcmp.c
syscalls, x86: add __NR_kcmp syscall
2012-05-31 17:49:32 -07:00
Kconfig.freezer
Kconfig.hz
Kconfig.locks
locking: Adjust spin lock inlining Kconfig options
2012-09-13 17:56:13 +02:00
Kconfig.preempt
locking/kconfig: Simplify INLINE_SPIN_UNLOCK usage
2012-03-23 13:18:57 +01:00
kexec.c
kdump: append newline to the last lien of vmcoreinfo note
2012-07-30 17:25:20 -07:00
kfifo.c
[media] kernel:kfifo: export __kfifo_max_r symbol
2012-04-11 18:24:37 -03:00
kmod.c
kmod: avoid deadlock from recursive kmod call
2012-07-30 17:25:20 -07:00
kprobes.c
kprobes/x86: Fix to support jprobes on ftrace-based kprobe
2012-09-13 22:52:11 -04:00
ksysfs.c
kthread.c
kthread: Implement park/unpark facility
2012-08-13 17:01:06 +02:00
latencytop.c
lglock.c
brlocks/lglocks: turn into functions
2012-05-29 23:28:41 -04:00
lockdep.c
lockdep: Check if nested lock is actually held
2012-09-13 17:00:44 +02:00
lockdep_internals.h
lockdep_proc.c
lockdep_states.h
Makefile
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2012-10-01 10:28:49 -07:00
module.c
Guard check in module loader against integer overflow
2012-05-23 22:28:53 +09:30
mutex-debug.c
mutex-debug.h
mutex.c
sched/rt: Use schedule_preempt_disabled()
2012-03-01 10:28:03 +01:00
mutex.h
notifier.c
nsproxy.c
padata.c
padata: Fix cpu hotplug
2012-03-29 19:52:46 +08:00
panic.c
panic: fix a possible deadlock in panic()
2012-07-30 17:25:13 -07:00
params.c
params: replace printk(KERN_<LVL>...) with pr_<lvl>(...)
2012-05-04 17:28:18 -07:00
pid.c
mm: add a low limit to alloc_large_system_hash
2012-05-24 00:28:21 -04:00
pid_namespace.c
pid-namespace: limit value of ns_last_pid to (0, max_pid)
2012-09-17 15:00:38 -07:00
posix-cpu-timers.c
posix-timers.c
printk.c
printk: Fix calculation of length used to discard records
2012-08-12 21:25:50 +03:00
profile.c
ptrace.c
userns: Convert ptrace, kill, set_priority permission checks to work with kuids and kgids
2012-05-03 03:28:51 -07:00
range.c
rcu.h
rcu: Allow nesting of rcu_idle_enter() and rcu_idle_exit()
2012-02-21 09:06:12 -08:00
rcupdate.c
rcu: Add PROVE_RCU_DELAY to provoke difficult races
2012-09-23 07:42:49 -07:00
rcutiny.c
rcu: Move TINY_RCU quiescent state out of extended quiescent state
2012-09-23 07:42:52 -07:00
rcutiny_plugin.h
rcu: Move TINY_PREEMPT_RCU away from raw_local_irq_save()
2012-09-23 07:42:51 -07:00
rcutorture.c
rcu: Prevent initialization race in rcutorture kthreads
2012-09-23 07:42:23 -07:00
rcutree.c
rcu: Apply micro-optimization and int/bool fixes to RCU's idle handling
2012-09-26 15:47:18 +02:00
rcutree.h
rcu: Ignore userspace extended quiescent state by default
2012-09-26 15:47:01 +02:00
rcutree_plugin.h
rcu: Make RCU_FAST_NO_HZ handle adaptive ticks
2012-09-26 15:44:02 +02:00
rcutree_trace.c
Merge remote-tracking branch 'tip/smp/hotplug' into next.2012.09.25b
2012-09-25 10:01:45 -07:00
relay.c
splice: fix racy pipe->buffers uses
2012-06-13 21:16:42 +02:00
res_counter.c
rescounters: add res_counter_uncharge_until()
2012-05-29 16:22:27 -07:00
resource.c
resource: make sure requested range is included in the root range
2012-07-30 17:25:21 -07:00
rtmutex-debug.c
rtmutex-debug.h
rtmutex-tester.c
rtmutex.c
rtmutex.h
rtmutex_common.h
rwsem.c
Remove all #inclusions of asm/system.h
2012-03-28 18:30:03 +01:00
seccomp.c
seccomp: fix build warnings when there is no CONFIG_SECCOMP_FILTER
2012-04-18 12:24:52 +10:00
semaphore.c
semaphore: fix improper comment reference to mutex
2012-04-05 17:15:55 -07:00
signal.c
task_work: Simplify the usage in ptrace_notify() and get_signal_to_deliver()
2012-09-13 16:47:37 +02:00
smp.c
smp: Remove ipi_call_lock[_irq]()/ipi_call_unlock[_irq]()
2012-06-05 17:27:14 +02:00
smpboot.c
hotplug: Fix UP bug in smpboot hotplug code
2012-08-13 17:01:07 +02:00
smpboot.h
smpboot: Provide infrastructure for percpu hotplug threads
2012-08-13 17:01:07 +02:00
softirq.c
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2012-10-01 10:43:39 -07:00
spinlock.c
locking/kconfig: Simplify INLINE_SPIN_UNLOCK usage
2012-03-23 13:18:57 +01:00
srcu.c
rcu: Implement per-domain single-threaded call_srcu() state machine
2012-04-30 10:48:25 -07:00
stacktrace.c
stop_machine.c
sys.c
kernel/sys.c: avoid argv_free(NULL)
2012-07-30 17:25:13 -07:00
sys_ni.c
syscalls, x86: add __NR_kcmp syscall
2012-05-31 17:49:32 -07:00
sysctl.c
sched: Add time unit suffix to sched sysctl knobs
2012-09-04 14:31:34 +02:00
sysctl_binary.c
mm: prepare for removal of obsolete /proc/sys/vm/nr_pdflush_threads
2012-07-31 18:42:40 -07:00
task_work.c
task_work: task_work_add() should not succeed after exit_task_work()
2012-09-13 16:47:34 +02:00
taskstats.c
taskstats: check nla_reserve() return
2012-07-30 17:25:21 -07:00
test_kprobes.c
time.c
time: Remove bogus comments
2012-03-15 18:17:55 -07:00
timeconst.pl
timer.c
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2012-10-01 10:45:16 -07:00
tracepoint.c
static keys: Introduce 'struct static_key', static_key_true()/false() and static_key_slow_[inc|dec]()
2012-02-24 10:05:59 +01:00
tsacct.c
uid16.c
userns: Convert setting and getting uid and gid system calls to use kuid and kgid
2012-05-03 03:28:41 -07:00
up.c
user-return-notifier.c
user.c
userns: Silence silly gcc warning.
2012-05-19 15:44:40 -06:00
user_namespace.c
userns: Store uid and gid values in struct cred with kuid_t and kgid_t types
2012-05-03 03:28:38 -07:00
utsname.c
userns: Use cred->user_ns instead of cred->user->user_ns
2012-04-07 16:55:51 -07:00
utsname_sysctl.c
wait.c
watchdog.c
watchdog: Use hotplug thread infrastructure
2012-08-13 17:01:07 +02:00
workqueue.c
workqueue: reimplement work_on_cpu() using system_wq
2012-09-19 10:13:12 -07:00
workqueue_sched.h