Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1360485rdh; Mon, 25 Sep 2023 10:14:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHlHcySfAYj7bX6vbwzU74wAKU5UwOlZRxr1Ts6i1MF9GPNhdkC4g83xM/HtNKdHlm/lxF9 X-Received: by 2002:a05:6a21:190:b0:15b:2125:88d1 with SMTP id le16-20020a056a21019000b0015b212588d1mr10966284pzb.2.1695662077981; Mon, 25 Sep 2023 10:14:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695662077; cv=none; d=google.com; s=arc-20160816; b=Lfm7mxfWsvVcpZR7+NgogwaUhJmJoqB6T37dtA3AZATERywGRrdySlD2z3Lo0vDQB6 MmmCYlF6LqUaaxpRvK/a8yuEcIDFtKIUXy1r4KnqroB6VoAy7+KRS3tv6OffEr5wCvba uxjNpYW/aS33MFbe7ThMP6MY8KQ0y7lxYQA9tNo/dTtfGF8gQN9DLa52qERkJjnfaAGW mkJ/nSp4QIbiJ5GNuNs9ZSZJ3de2Oqy3zATFt3DeAnhcNjZBEz2L6YBoMLal6NPv8vvn Nd0YEkZK+cDJQ7Rzub6G6QE0iR1Xq1g+S9RKMe90Zl9jBcCGBjodroZA+RpT9piXZxvz c51g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=FsVwcIMcXgFsiUVKDmRKkuK9uYVF+Xg1uxYKZQZf4yM=; fh=lK8zRUJ5Z1+euMBaWULSBI/TiSGmV+fS6MtMYfs4wSQ=; b=xuhZXH2aOlnAe4IDKtQCn7aZUbbOD33vlDUKG0ObHoEqG+TjucQyoWKDSBDebxDyZZ C+sO4Ahh3koC8nwyRRqhRWOnTrhJKa1Jt28FYZsXbtDbYFx4lmf3PGjdGWNeAYxsz4Eq YB/x6gXgY6Ab5gGHm8esqT+A9lj8yBD0KAQCd9sGAKeD70npsn+DDC3r3ENMw8yp1e45 zrkLCNt43GJuojGOmtV3P615WnCqkZiL8pbyZtIE8grZ94EI1vtMxRiQGTZPwpyvAg6q LcyzjM4eEE9pzE2+fPvZ0ZxOweI0zfjfQ0FQhxrwTT4cE60gnmb530hczsGsFrXhsqCk 46UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shopee.com header.s=shopee.com header.b=SWJxSoHL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=shopee.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id 14-20020a63020e000000b00565335587absi10248681pgc.802.2023.09.25.10.14.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 10:14:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@shopee.com header.s=shopee.com header.b=SWJxSoHL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=shopee.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 3220F81222A4; Mon, 25 Sep 2023 03:23:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230467AbjIYKXI (ORCPT + 99 others); Mon, 25 Sep 2023 06:23:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229705AbjIYKXH (ORCPT ); Mon, 25 Sep 2023 06:23:07 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 604539F for ; Mon, 25 Sep 2023 03:23:01 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1c5ff5f858dso13695825ad.2 for ; Mon, 25 Sep 2023 03:23:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shopee.com; s=shopee.com; t=1695637381; x=1696242181; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FsVwcIMcXgFsiUVKDmRKkuK9uYVF+Xg1uxYKZQZf4yM=; b=SWJxSoHLHLgf2sAZD+N71VMECKuV8WjksKd0FTMZLArWuunGL0dKoGHFPrkPRx89ad 1opH1D8yevN1DaOIZfdezgVJmzOrB4O7/YdXIYRZFpGzDTtEE4AIicIqvEzRJozI3c7I Qc6yWke8erwxzYrS/mUuXfxRhng3ZIy7kos4c+mliJ1qLcE9THlBEkzd5zAZJsPaGT1S fcIididvEuZVtE/30sjFWZxN5bxxVkOVFheTFVVXnlfmRK7ZEVmLvZAGAZRWhoSr3oTB TC+pPNxJ5FqwahBzk1L6vbv7XqNAHHPduqhqIZR5/3RamrOQ6oIhUQqqr6ESL2RfLm5r Kypw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695637381; x=1696242181; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FsVwcIMcXgFsiUVKDmRKkuK9uYVF+Xg1uxYKZQZf4yM=; b=RnS2xow0FdV4V0Qi7X54t3bwCGQ4baHQ31L2rgb6+tpbas+fbV3LQUM/pdZ88MYT1b t5yozXdpp85xdW5WAPzu2HISxZOOiDMrA5jrfaUH2WJ3hIvoykcbmMESejABjEahoAQF VdVuW8STnKV+51Kv1prn/Cyh2pMN/eG+edGZbKE+0b3PwHY4jIKki0VLG7+fdAgPxsDJ iBzAAd3WXJMWgZZZsRiVuZSRJGxRkIrfU9g7ktNPAuKwT3FjMwor27yps5KHgcPYpQqb qyIf6Lac/yp6ymeRBIxsfFRAWQhD/2df8ykew1P44sikQ8f2Zm8jdwymZRhlMBaKy2mz zL4A== X-Gm-Message-State: AOJu0YwEk1iJB63KTWU/QMLG4Gf2AZIRGwZBToEACznih+mvz3ajtSQh ZRl3DphlX+67Vaq64tWL9+lRnCGL2FnY6pxgn3of5JWv X-Received: by 2002:a17:903:26d4:b0:1c1:f3f8:3949 with SMTP id jg20-20020a17090326d400b001c1f3f83949mr3992812plb.1.1695637380840; Mon, 25 Sep 2023 03:23:00 -0700 (PDT) Received: from ubuntu-hf2.default.svc.cluster.local ([101.127.248.173]) by smtp.gmail.com with ESMTPSA id g9-20020a170902868900b001bbdf32f011sm8385011plo.269.2023.09.25.03.22.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 03:23:00 -0700 (PDT) From: Haifeng Xu To: hannes@cmpxchg.org Cc: surenb@google.com, linux-kernel@vger.kernel.org, Haifeng Xu Subject: [PATCH] sched/psi: bail out early from irq time accounting Date: Mon, 25 Sep 2023 10:21:43 +0000 Message-Id: <20230925102143.462545-1-haifeng.xu@shopee.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 groat.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 (groat.vger.email [0.0.0.0]); Mon, 25 Sep 2023 03:23:08 -0700 (PDT) We could bail out early when psi was disabled. Signed-off-by: Haifeng Xu --- 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