Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1667571rwd; Thu, 15 Jun 2023 13:57:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5tm+F8HKF7P6QsfmBB54b2bgzRD7ptkvX0F/xffjVMlRSQNpL0KXQQzuVQ+IYbBVIeBIEW X-Received: by 2002:a05:6a21:338a:b0:10e:96a4:e31d with SMTP id yy10-20020a056a21338a00b0010e96a4e31dmr8267900pzb.22.1686862677015; Thu, 15 Jun 2023 13:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686862677; cv=none; d=google.com; s=arc-20160816; b=Knw1H2tLU0W7pLXin36x59rPH1wmn1PHYPf57n2ek4BkAqkPj4rHKlxSQUH5Vhs5LB fH8H71o/x6spiUHovVXNzIAylqBASyxdPRnsrLU9KeZ+8UTuQlxzn7lvw5piPydWIJ55 y6llhI19ESHGG8spNi2+nTxSJwlOMmRbKLb11loT3lWXJ4WiZbWXHJDsx4rB/mqnEuAK ddOcGUoishV6rbBfbIzezEhCJAmddmWhDeU7TRFquJ+BnWQVpHHSl5R/vrGB/W0k115N NYJdqCOmsMHcj1Wz5eS4R27ZEiP8NjrHgPhGYYNxm8QmmcoaCTWJvQ53rkJNhiE4mNZB fQFg== 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; bh=xlt6XK9hN90RySb2MwOIg8snE8yI6VawU/byzCJpPMo=; b=TK5e9cfD5BuIYpks5XLrZWjGnJFxxgbfbdbOlT/r8kqHPSjkFzPF3fIWbAl6J+mbpW cu5R3Rj3C7WrM8I1lLnV0DVS/YHttGiG07mzMeYiZCxwqUSS98N3okhgoTgHiGpfiMhm 2WP6QZkqal0zO0WzwbPXEow+q953RU2MMcr4XRsYmHIQU2pyB7woEdZE+tYyjUoya06q Z2sy7IwubvEzOVOf8l24Uj1dZbeZjcTSh1F8w/Bi7MFcMYLZk1/yDZwEeRgcatnlGI1H 4ODARkkfVpLNvfM+R34S3SL0SmoXGapLb1UHotQWBD7Xcp1oSkLTuHjul0pD0z8aKuvM aWsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l20-20020a639854000000b005533c53e642si617786pgo.47.2023.06.15.13.57.44; Thu, 15 Jun 2023 13:57:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229957AbjFOUiE (ORCPT + 99 others); Thu, 15 Jun 2023 16:38:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjFOUiD (ORCPT ); Thu, 15 Jun 2023 16:38:03 -0400 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 634D2DF for ; Thu, 15 Jun 2023 13:38:02 -0700 (PDT) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1b505665e2fso9230455ad.0 for ; Thu, 15 Jun 2023 13:38:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686861482; x=1689453482; 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=xlt6XK9hN90RySb2MwOIg8snE8yI6VawU/byzCJpPMo=; b=i4WU4YaIuYXZ7AcYaqhOpHXqFIJM56oxddXNKiLMXXHR2oVeFWl4ERS8sTfm3EL/9w IkrMi+gkYrXNU5xYMjCbeXxsox6D6ONUgyh5qzcbCT0YLubJdPVIsFc5eRtSFJNFjQ4O uu4bhQfoaOggcGAsvK8kJ/8ArS2stpjLHx0OF0wPGhCJQQXDHzw2Ujp58POJllGiNtX4 TaPSIgrSJx3CpZrilFEKcnh1NHZP8CGbduy26GoPXRimijq1TioxmqMnEqvjmVorHT/v oz4cXqXScEtO/CE0TFcXIRB8K6P+XBWqVMEwrxClXmZAY9Dn/zwxSYrxZBBRTgRIiN1J j6tw== X-Gm-Message-State: AC+VfDza6qQUHEuoPXgfmYlCsphlVcglATsKYL/B9X1nwGjZi7fAI56a 2Pcn/ujq5mNcKj6u8cY10tHTjx9bVaw= X-Received: by 2002:a17:902:c951:b0:1a2:a904:c42e with SMTP id i17-20020a170902c95100b001a2a904c42emr9208116pla.24.1686861481675; Thu, 15 Jun 2023 13:38:01 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([98.51.102.78]) by smtp.gmail.com with ESMTPSA id y20-20020a170902b49400b001a980a23804sm14487233plr.4.2023.06.15.13.38.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 13:38:01 -0700 (PDT) From: Bart Van Assche To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Bart Van Assche , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt Subject: [PATCH] sched/cputime: Make IRQ time accounting configurable at boot time Date: Thu, 15 Jun 2023 13:37:26 -0700 Message-ID: <20230615203745.1259-1-bvanassche@acm.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some producers of Android devices want IRQ time accounting enabled while others want IRQ time accounting disabled. Hence, make IRQ time accounting configurable at boot time. Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Juri Lelli Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Steven Rostedt Signed-off-by: Bart Van Assche --- Documentation/admin-guide/kernel-parameters.txt | 4 ++++ kernel/sched/cputime.c | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 9e5bab29685f..67a2ad3af833 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -5611,6 +5611,10 @@ non-zero "wait" parameter. See weight_single and weight_many. + sched_clock_irqtime= [KNL] + Can be used to disable IRQ time accounting if + CONFIG_IRQ_TIME_ACCOUNTING=y. + skew_tick= [KNL] Offset the periodic timer tick per cpu to mitigate xtime_lock contention on larger systems, and/or RCU lock contention on all systems with CONFIG_MAXSMP set. diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index af7952f12e6c..d9c65017024d 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -24,6 +24,19 @@ DEFINE_PER_CPU(struct irqtime, cpu_irqtime); static int sched_clock_irqtime; +static int __init sched_clock_irqtime_setup(char *arg) +{ + bool enabled; + + if (kstrtobool(arg, &enabled) < 0) + pr_err("Invalid sched_clock_irqtime value\n"); + else + sched_clock_irqtime = enabled; + return 1; +} + +__setup("sched_clock_irqtime=", sched_clock_irqtime_setup); + void enable_sched_clock_irqtime(void) { sched_clock_irqtime = 1;