sched/psi: Bail out early from irq time accounting
authorHaifeng Xu <haifeng.xu@shopee.com>
Tue, 26 Sep 2023 11:57:22 +0000 (11:57 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 13 Oct 2023 07:56:29 +0000 (09:56 +0200)
We could bail out early when psi was disabled.

Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Chengming Zhou <zhouchengming@bytedance.com>
Link: https://lore.kernel.org/r/20230926115722.467833-1-haifeng.xu@shopee.com
kernel/sched/psi.c

index 44a78774ae875ff06cf642e421a5539d7a6ed7e8..519bc922a9600b9d17afc975a48de82252a0cf1b 100644 (file)
@@ -998,6 +998,9 @@ void psi_account_irqtime(struct task_struct *task, u32 delta)
        struct psi_group_cpu *groupc;
        u64 now;
 
+       if (static_branch_likely(&psi_disabled))
+               return;
+
        if (!task->pid)
                return;