From patchwork Wed Sep 16 06:45:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 256763 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18F2AC433E2 for ; Wed, 16 Sep 2020 06:45:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B06AC20771 for ; Wed, 16 Sep 2020 06:45:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PxfXjSTS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726132AbgIPGpl (ORCPT ); Wed, 16 Sep 2020 02:45:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726068AbgIPGpj (ORCPT ); Wed, 16 Sep 2020 02:45:39 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA177C06174A for ; Tue, 15 Sep 2020 23:45:38 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id z18so859496pfg.0 for ; Tue, 15 Sep 2020 23:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hNl9ITrOlajUMgfeY7jtp0iUw/AIlMS1zuHDQ3GtgZY=; b=PxfXjSTSmEEAg0XRSuDnRxTu6Nbxb9kijG1V/9xC3o1wNdR+/WiKc6ioEbvKguXR1c S3u3kuf15rxHpqpttJ+2uv8MkjVWFP+lip0kK3Q9mPRCni7npeX3xFY4KIocJJveyZSO 6KsnrmzeyJyW26LiwnpT05Pxt6AlCJ7FS2s377Jr+xEimNPggqL0WUtinTKgRhLn4Weq mfY2b3RDapNZS5VkkyC8/FXQwGH8Mo0/y8A1UAQI0HripqRFBaxDUgJVKM8AR1KLh7kD bF6xAFMsZ8nSeGK9Yqt6y2TOkiDO5Xezq0RlT/KW7Gd9yHJrTGGinXrf+fUt8KASfZv2 jzEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hNl9ITrOlajUMgfeY7jtp0iUw/AIlMS1zuHDQ3GtgZY=; b=FGDGqqzKgxYJQC9u2mPCXsNfQ857fg8NwFRRMsPFYA2TJFvlWB4Kk4StWQsS+0UVKI Vf8hmJrx5WmpU9EKo8KI1LZaYi5caD00QK1QibC9iP3cKn8FpH6frUIIrwMfRxJX0loT Qcu/v6573lYpz7ZsfiIB0PxOuM8y/mMaAnMBfrXKbj50F85SEwmbKBkfkQwZ6tWBPIE9 OW8s6d9j9iVsBfGDl0/EF+s8b9OFz8itVnfbMPeVAXtIBv+dU9eWZkUOSVufReVrTjz5 sm5B3nS8WXZXjiHt16/x1G5Al3XO2MiPoxRjKsNA5LN2Oyn2Q0+2CrB+xFRLIMUftMtl vLlA== X-Gm-Message-State: AOAM532DZQe5SQPNl7fxsC9ENN9iCVb+JwuAtVCCrVSwGCZBfxV/Gfd5 UgLzrgeSMXO49vv3Lo7ThYysZQ== X-Google-Smtp-Source: ABdhPJyF8u9Cgnqm5WUErB3pmar0qZDxVNDnl9YlNmZw49yxUFnLXwHu7DPX5//hssQihUTP0vAWHg== X-Received: by 2002:a05:6a00:14cb:b029:142:2501:34eb with SMTP id w11-20020a056a0014cbb0290142250134ebmr5088248pfu.68.1600238738255; Tue, 15 Sep 2020 23:45:38 -0700 (PDT) Received: from localhost ([122.181.54.133]) by smtp.gmail.com with ESMTPSA id a9sm1426588pjm.40.2020.09.15.23.45.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2020 23:45:37 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Ben Segall , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Steven Rostedt , Vincent Guittot , Viresh Kumar Cc: linux-pm@vger.kernel.org, Lukasz Luba , cristian.marussi@arm.com, sudeep.holla@arm.com, linux-kernel@vger.kernel.org Subject: [PATCH V2 0/4] cpufreq: Record stats with fast-switching Date: Wed, 16 Sep 2020 12:15:27 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi, We disabled recording cpufreq stats when fast switching was introduced to the cpufreq core as the cpufreq stats required to take a spinlock and that can't be allowed (for performance reasons) on scheduler's hot path. Here is an attempt to get rid of the lock and bring back the support. V1-V2: - Use READ_ONCE/WRITE_ONCE instead of atomic in the first patch. --- Viresh Viresh Kumar (4): cpufreq: stats: Defer stats update to cpufreq_stats_record_transition() cpufreq: stats: Remove locking cpufreq: stats: Enable stats for fast-switch as well cpufreq: Move traces and update to policy->cur to cpufreq core drivers/cpufreq/cpufreq.c | 16 +++++- drivers/cpufreq/cpufreq_stats.c | 87 ++++++++++++++++++++------------ kernel/sched/cpufreq_schedutil.c | 12 +---- 3 files changed, 72 insertions(+), 43 deletions(-) base-commit: 856deb866d16e29bd65952e0289066f6078af773