Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1885292rdb; Tue, 3 Oct 2023 04:21:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdfzhbtCUopz2D3lg4A1ogAgeGU4z7slxt9Q/3frk1EVE4W19IjrHvamqtpdFOWAFC3O6n X-Received: by 2002:a17:903:48c:b0:1c5:dfe9:b1f3 with SMTP id jj12-20020a170903048c00b001c5dfe9b1f3mr11604675plb.16.1696332068526; Tue, 03 Oct 2023 04:21:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696332068; cv=none; d=google.com; s=arc-20160816; b=j4aCLWE6DpqFd50eU2IYmpXqbceIhh3rBLm2CdIt9NuKViV/5tb8Ibf7yNumCTwOzy FyQyTQrMzN7/3k1ww5mxIN6A7QthBGhw4X5iK+xwgK7iExZ37FQU9+ihg/NAgnuuNY1I yKr0XfJSSGJzIEbbEyP0c1vNMnbXotXdUV6Eiyh//7l0ZqYNoR8urZ1Lu1Twr2YgysTs zGuswqP9Q92CIvJrwyhDbG5fkwNXUNscpi//Aog4muk2ErRhrLks1etH4mp9u+fBw012 PHlmr388s+q3MGB60rWWQs04wFKesZTORwzP2TlSTvz8itu4q5/b75KNn7+zKXaPBmDC Gk2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=g5jU80hlu7hzguF/ewWt0WdyRug8yRAZnGTuHUaXgVg=; fh=QTj3qI9cj0PWyRteRrb0kE72w4j3VHfqrP1H4Nk5o80=; b=0BA7X+wiVKrQBCjnXBS6R+d0N9odBVNjZ/3fzrkkSOAj9mOhqTT/JG076OQoW+BJL1 dIQWfAsqVf6s7xBuOCOBHXCYckbVBV/wGM5/N/FUbYHp0zEWqwPHwIn92l3fa3CD2G2l gmumW60Qv/G9Jahxz93KTz/aI8bMafYxTzmCmm7SK2Of+AO0T1zeYIp1j36jrcB7j+4n 5reGy2i5RgoJMdCDqfEzUtDCsJc8ROWuxrFB1HyYpM5QdO+z7aA+B9Px/rbdv5UO0ti8 m3MvFhvds506Uwr0txJBb8tg2JZZ2/X6d2XXupfrBzj+U6xGEbxajkTi6GldK8UOYj5s Gwew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=mxbrY1e5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id jh21-20020a170903329500b001bf20c80685si1158470plb.125.2023.10.03.04.21.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 04:21:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=mxbrY1e5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3F7118056910; Tue, 3 Oct 2023 04:20:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239928AbjJCLUq (ORCPT + 99 others); Tue, 3 Oct 2023 07:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231337AbjJCLUo (ORCPT ); Tue, 3 Oct 2023 07:20:44 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4EC0AC for ; Tue, 3 Oct 2023 04:20:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=g5jU80hlu7hzguF/ewWt0WdyRug8yRAZnGTuHUaXgVg=; b=mxbrY1e5REZvzADGLf43OvnOkG gQnLPKlf6ST/75uG9HCcRxepKqHEBXF5Pj6gbKkQv20I/mAeNH4BU7ThNCZUje480oJ3V4sbhDCNb tVXSmFO8nBDmGKnmjOhX53IF82C7NTABbBdPiGx0pJ5OskgbE7X1mmxKSLI0TRXe7uJzoFoHLy2vr YY9yoS4qf3G5mlSw6RVDqMUpg0xCVlwF2TFmGK0KI75KNYGcWa9sKdi3oDCK2DVrmHacJeMGfqQyQ qf9RB5lzT/XpFnrZyfFFQ2l5mFx9CV+GCQe49Y8nv89TcsYWutn8NXQvTgthaRlL53xc9jQeW+wPF s78aS8Sg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qndS4-009qDt-0z; Tue, 03 Oct 2023 11:20:33 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 6D37A300348; Tue, 3 Oct 2023 13:20:33 +0200 (CEST) Date: Tue, 3 Oct 2023 13:20:33 +0200 From: Peter Zijlstra To: Haifeng Xu Cc: hannes@cmpxchg.org, surenb@google.com, zhouchengming@bytedance.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND] sched/psi: bail out early from irq time accounting Message-ID: <20231003112033.GH27267@noisy.programming.kicks-ass.net> References: <20230925123106.GB347250@cmpxchg.org> <20230926115722.467833-1-haifeng.xu@shopee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230926115722.467833-1-haifeng.xu@shopee.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 03 Oct 2023 04:20:56 -0700 (PDT) On Tue, Sep 26, 2023 at 11:57:22AM +0000, Haifeng Xu wrote: > We could bail out early when psi was disabled. > > Signed-off-by: Haifeng Xu Thanks! > --- > kernel/sched/psi.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c > index 81fca77397f6..e74e14762d49 100644 > --- a/kernel/sched/psi.c > +++ b/kernel/sched/psi.c > @@ -1005,6 +1005,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; > > -- > 2.25.1 >