From patchwork Mon Oct 10 07:23:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hongchengwen X-Patchwork-Id: 614083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56835C433F5 for ; Mon, 10 Oct 2022 07:32:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232034AbiJJHcC (ORCPT ); Mon, 10 Oct 2022 03:32:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232093AbiJJHbl (ORCPT ); Mon, 10 Oct 2022 03:31:41 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2088.outbound.protection.outlook.com [40.107.255.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36E2E46238; Mon, 10 Oct 2022 00:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gh370xZ296JHRhQcXYRq0ttMq2RlqNh982vqbUJRzgN47JACN+ZzXl3nE23oC4u62elv7ZwKo+ix7paXJtD0ZHRJj7VitlTpiVZKUYLOKY2EWhflDk+JiVgrvXsOiWrI6PyfY6auZ1ut7lOCfeOcD7nDcd7nBEQxSSvmPzFXZXUD0ULZ9mCpM9a4SB+UQ5s+BNoNFcgcQADQZLjPT6G9g36FZxR6ZcoU/INXUkSRuF1FwiDb0IGNt/Ru//ZgvwEBqN02m2Le+sVzUqdbPeolJMu2Ka3YzWfTdM+zgyeFCPGGTTwkUTnz709HkmuEgvm4XN3zxWOfYqalyQYplMXdcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RGNgz5NhBdbGp9k7dLt3a7VOlsNKipIAeQiaSN5OfjY=; b=TMS0yRKrum8NDZyJnww8aTGNGbZGnPcnrRm+YItBJE4teJUFttDcfh3aI9BpCiPa4T1ZJKYoTaf52uLSq2HtMQ0KvP0RNXVFcFZpYhZyTpV2nIMI24Z+3yKQ/IlF/wRZ2XFoTrGizA7H7UcGwxcW7bKeKfIZ5eEvgY+cGaxHyOEX+JYE3b7iUlzoL9kSuD3l+bSbzQ/3j1ERg2T5czPuMNx7W5f0bGgwx4O6jpB5cu640NXTSoWqYBgIuqWQX3YKzfMS3MPsP2teawVCBcHhAn8BQDX+s/OATzMgi1GodPCJsgc1nGhH9+EyJyznhE6K3wpq5EIgXL46IwNYqVlrXw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RGNgz5NhBdbGp9k7dLt3a7VOlsNKipIAeQiaSN5OfjY=; b=tSQqhzu2ceDZULTPSspY2nT2UPkBdTnjG+tvjtSdVM/y6LnxZPw0ksKZy7jOtzlv/LW6+PgtOcGGEi1+6zvvyD8Q3W7BVMwCXpxvzmxvKabmB7eJqLJaGtNvrt2t/DE+vGuCpqEz6DPX8IZyaI5lcs1sYVL2JsIhs9DnqMmRmyg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from HK0PR02MB3379.apcprd02.prod.outlook.com (2603:1096:203:7e::13) by TYZPR02MB4527.apcprd02.prod.outlook.com (2603:1096:400:33::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.31; Mon, 10 Oct 2022 07:24:36 +0000 Received: from HK0PR02MB3379.apcprd02.prod.outlook.com ([fe80::9908:e73b:e847:8033]) by HK0PR02MB3379.apcprd02.prod.outlook.com ([fe80::9908:e73b:e847:8033%7]) with mapi id 15.20.5709.015; Mon, 10 Oct 2022 07:24:35 +0000 From: hongchengwen To: rafael@kernel.org, viresh.kumar@linaro.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, zhengding chen Subject: [PATCH] cpufreq_times_record_transition() is not called when fast switch is enabled, leading /proc/[pid]/time_in_state to attribute all time on a cluster to a single frequency. To fix this, add a call to cpufreq_times_record_transition() in the fast switch path. Date: Mon, 10 Oct 2022 15:23:58 +0800 Message-Id: <1665386638-342822-1-git-send-email-hongchengwen@oppo.com> X-Mailer: git-send-email 2.7.4 X-ClientProxiedBy: SG2PR02CA0074.apcprd02.prod.outlook.com (2603:1096:4:90::14) To HK0PR02MB3379.apcprd02.prod.outlook.com (2603:1096:203:7e::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HK0PR02MB3379:EE_|TYZPR02MB4527:EE_ X-MS-Office365-Filtering-Correlation-Id: da987c8e-548c-4031-d5f0-08daaa907bdd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2jnHkKp3LNPN8pwN4AlSGP4+ydTE8gceSCQwAVOxL6CGOEIZMkegL42b8DU+iciHVPU7rO73Ch5hwF2XtoPFG2Sa7p5tL4zWRlxcYp5TlgTK/ZwMet3OQTXsefiXvU9gN+ScS3/vOGOqm5T8ULCW+XVGBT3wwtZejyAnPlUhn3btHxUOz5rG6Xoyq7aMcjIhnQMAsYt5bOEC9j85vRpNhIiq07WZpE1JPY6hMkbk2FnsTrrt80Zofo+SBUmxf7d6kGltD0+9SGveuvb2j8ByRhdK9agvEBZAWZUWC4odfXJqDroXq5wygneMOnHeSXQvwSTmfLcrJA0xD8uIHFNllZIyW79dLdzKsENU5hOp88iz/96P0xWjVC/d6iQTFMevAsQsXRRgxNm3ly4WZF3yaVcHbrPT/2/VrWfwgbHd4ziChovxFq99ondq3aLC9Uo8cc3EAtFPcMLgEKFZyA1JC22Tzmqb043N+cZQWY3cv8m53mIYEiutoGM+rjrKnGJDUhV2VyYfKqFDqmc/Jx0OmbThN+h+7V5ksH14RTV6EaJw6W04lmfUg7o11OT5K384Q/6M2cejkbOXRCN8QF26SF5O0942hn7uiKtvpOVQaVWdOatgtDGQMFfYZCQtHAQgZfWiH50qHbe6zZT0aXS3H2KTmCqsMXk2qFV5Wx0blNKAMLWeeoVvs6JjAnZIWJW55CVkfeyJs1qoS5eY6wKy4QxGx4dHsRx6yQ156eRGjl8wp62NbbGxZhdXPaiqfcWm4szqlAIDW0OdLmj3eXFZhw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:HK0PR02MB3379.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(396003)(346002)(376002)(136003)(366004)(39860400002)(451199015)(4326008)(66946007)(52116002)(2616005)(316002)(2906002)(5660300002)(186003)(8676002)(107886003)(6666004)(6506007)(66476007)(36756003)(8936002)(83380400001)(66556008)(41300700001)(38350700002)(38100700002)(86362001)(26005)(6512007)(6486002)(478600001)(219693005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E4CD46jSp0RtPu6aVRwwqX4JTQuYLz33l/QQ9Bqpi1cLbS8Nk3YCPRUjTWVDGv28VNsgLsLRw6nTWmXdDIo54tEu0tKg54uN05OMapuvzGqdhsCyagHnx+ytHwq6uye0hidoReTINbCXQu8fHnAMhE3knddrAzmkw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bWd7qJLompg3lJI5ns8Ww3qdv8ZeF4CzkKHso2NjA4GwiE2zlLHvJ3qdf06YXsKt0HvoDRfzCSzh0W5mdtVhaKhRf7zEjf+HlcGcpdn9kXpwc9KWwe65jHh+DIee0wHwNvOQQNAUrotNL4Zb6A49sZZyEkY1Sue2t4BqMAIzvfptC7kii5MSrtNhBZFp8uZFDO1RI60MtDbtOpnpdkFreVqiRd3Hy+yoUacc9Vqdp8EhhRZFA+n59jCXxbVlqzKnyTjt+D9z3s/EK0MQ8Fou1HGXJuGiYUqtD3+oYuYjW/8rkpKsow/wfoWWgqJOmntxPlXPhSimoan+bPPFzNp3GIHTU0rAGVcKD/7qxxuEBnGKqEIazNh5huDDqRZJhFUA== X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: da987c8e-548c-4031-d5f0-08daaa907bdd X-MS-Exchange-CrossTenant-AuthSource: HK0PR02MB3379.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2022 07:24:35.8525 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZLfjjAHh6g6iXfX4khWrZp9FRo8xO0IpYJ3yy6B516CXUR84TpZj75rpR+rraI86EIAhb1iZnRLDNosuxx/otQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR02MB4527 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: zhengding chen Test: /proc/[pid]/time_in_state shows times for more than one freq per cluster Signed-off-by: zhengding chen --- drivers/cpufreq/cpufreq.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 69b3d61..1caaf63 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2128,6 +2128,7 @@ unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy, arch_set_freq_scale(policy->related_cpus, freq, policy->cpuinfo.max_freq); cpufreq_stats_record_transition(policy, freq); + cpufreq_times_record_transition(policy, freq); if (trace_cpu_frequency_enabled()) { for_each_cpu(cpu, policy->cpus)