Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
sched/cpuacct: Fix cpuacct charge
get_irq_regs only work for current running cpu, but the task, whose cpuacct will be charged, maybe run different cpu, like Cpu 2 wake up a kernel thread to CPU 3, cause CPU 3 task are charged with the following stack cpuacct_charge+0xd8/0x100 update_curr+0xe1/0x1e0 enqueue_entity+0x144/0x6e0 enqueue_task_fair+0x93/0x900 ttwu_do_activate+0x4b/0x90 try_to_wake_up+0x20b/0x530 ? update_dl_rq_load_avg+0x10f/0x210 swake_up_locked.part.1+0x13/0x40 swake_up_one+0x27/0x40 rcu_process_callbacks+0x484/0x4f0 ? run_rebalance_domains_bt+0x5a/0x180 __do_softirq+0xe3/0x308 irq_exit+0xf0/0x100 smp_apic_timer_interrupt+0x74/0x160 apic_timer_interrupt+0xf/0x20 </IRQ> RIP: 0033:0x456947 so define a get_irq_regs_cpu which returns the required cpu irq registers BUT it should be not safe, and do not know what it should be like in MIPS? Fixes: dbe9337 "(sched/cpuacct: Fix charge cpuacct.usage_sys)" Co-developed-by: Zhao Jie <zhaojie17@baidu.com> Signed-off-by: Zhao Jie <zhaojie17@baidu.com> Signed-off-by: Li RongQing <lirongqing@baidu.com>
- Loading branch information