From patchwork Thu Mar 14 06:42:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10852229 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 00F3D13B5 for ; Thu, 14 Mar 2019 06:43:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD7302A1BF for ; Thu, 14 Mar 2019 06:43:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0EDA2A1C4; Thu, 14 Mar 2019 06:43:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7C0FA2A1BF for ; Thu, 14 Mar 2019 06:43:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=tFm+QT+jNwuMtSoHu/V+hpPtWY6XwnQjkf+XyMQn5xA=; b=ZOn15XOZLJFrZo wXYbrFNnbqayUAjtX2uSMulvodC/WDK1c6Qbj49dY+btdU6wtmxlXBC7HMSrOq/9WlF/SHfYlUtHB ngYq+4gzqlol9XVngM2E8JjAYvj6qpEW0v7s+/W0Tt9i6aGs/oITgjCKcnQ3+osSKZtNAFNbpgI+H KGwYDK4Tiaove27Gfz+gXNeVv43WEwSrjyxWr9f2ZM5kZKPrYNArS4Ln4UPnEHWER/Fb47Javr4Vz +8GKq76/Tz4FLbR0CNHu/U21WQHK5uRIjRewH+HPU8ioP0ckoPngkqnHg1h12Kvbeg4Ynji1qcNRk 5EJl0EzeV85kb7ReLyEw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h4K5J-0003Yp-8D; Thu, 14 Mar 2019 06:43:21 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h4K5F-0003Xu-EL for linux-arm-kernel@lists.infradead.org; Thu, 14 Mar 2019 06:43:18 +0000 Received: by mail-pf1-x441.google.com with SMTP id v64so3194328pfb.1 for ; Wed, 13 Mar 2019 23:43:17 -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=5+5Cw5z33DIg1su6ZAUGhXXSsFuNvEeeUI9Xv45/m58=; b=choj6QuSgZ7wxLK9NEnm1WuZw7X2kxDkrYlJTBwSkSyerLOzHHGhZKWFF1Ez6zPiaO 3vW5/4Gtsw5rjr1ngc6bh8kPsQj+kjV5FKIVq7nBoptGdKup7FvvfK4cwX+vmqLVZ7BL GJW6UKZQCJuz4Pd7qPkyXFwDxsX9x0dp06tJamwEJ329GxZsfT5/l5d3v5aJJW09Jn1r D+p4YEQldkh4P70N0PICTYqp3tiiRBWCrY1bz7J031Ni9wclcUSD63V05n2rAn2jwQ7m juiAMIFNKk28O8ng9FCGC0aqic5RCA6LOuvVZ7QyrmgdUgem4OzQWvVRf4AidiNPkePa i8JQ== 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=5+5Cw5z33DIg1su6ZAUGhXXSsFuNvEeeUI9Xv45/m58=; b=j7SlkBWcuB38jp0k0S0biLTz2o2qQFfeL3DevcbzBC7+yT+hrER/lCi8G5wb1jUPiD pdpRyd12qowNDNrjMNvIrqQ6LX0SogmLq76mR1rbu866PLQnE5GVG5/aKBqqT043fby1 QR/n1lw0VUqtzp/kX76cJVu/erjOrjawdK46+NUynKGSBC7oY96uWspipoYndw8sr7r5 sORIDm/48hNPceNq1OFlc7rU11FJp1mHqvonas/nh0c7svS3RJZk4xyI1xq1PXWvIJ5M GlV2d+CjlK8BWSee+Pns1vlax2zenf89+KPRr1UTofhI4cKfyUWCxx16GWVxnlSo3S4C AdOA== X-Gm-Message-State: APjAAAVxr4GbdKoFjdyS8aNwGNGyL6AJfzLpC17oHUInvm5mFAxPQOUv rc2AYrtNUEY2fc5Yg8GKvVdNvg== X-Google-Smtp-Source: APXvYqzfZPOAXR4qUxqYyIY63Y/rMYs8i72UfcADk39hoDbPZX9Wfa/ze1+OALWIksGswXiJeQJpgQ== X-Received: by 2002:aa7:8a95:: with SMTP id a21mr925115pfc.14.1552545796399; Wed, 13 Mar 2019 23:43:16 -0700 (PDT) Received: from localhost ([122.166.134.37]) by smtp.gmail.com with ESMTPSA id h63sm46530100pfd.148.2019.03.13.23.43.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 23:43:15 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Borislav Petkov , "David S. Miller" , "H. Peter Anvin" , Ingo Molnar , Paolo Bonzini , =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= , Russell King , Thomas Gleixner , x86@kernel.org Subject: [PATCH 0/7] cpufreq: Call transition notifier only once for each policy Date: Thu, 14 Mar 2019 12:12:46 +0530 Message-Id: X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190313_234317_541065_02FF7827 X-CRM114-Status: UNSURE ( 9.33 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vincent Guittot , kvm@vger.kernel.org, linux-pm@vger.kernel.org, Viresh Kumar , linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Currently we call the cpufreq transition notifiers once for each CPU of the policy->cpus cpumask, which isn't that efficient. This patchset tries to simplify that by adding another field in struct cpufreq_freqs, cpus, so the callback has all the information available with a single call for each policy. I have tested this on arm64 platform and is compile tested for other platforms. This has gone through 0-day testing as well, I have pushed my branch over a week back to the public tree which gets tested by 0-day bot. FWIW, it maybe possible to make the callback implementation more efficient now that they are called only once for each policy, but this patchset only did the minimum amount of changes to make sure we don't end up breaking otherwise working code. --- viresh Viresh Kumar (7): cpufreq: Pass policy->related_cpus to transition notifiers ARM: smp: Update cpufreq transition notifier to handle multiple CPUs ARM: twd: Update cpufreq transition notifier to handle multiple CPUs sparc64: Update cpufreq transition notifier to handle multiple CPUs x86/tsc: Update cpufreq transition notifier to handle multiple CPUs KVM: x86: Update cpufreq transition notifier to handle multiple CPUs cpufreq: Call transition notifiers only once for each policy arch/arm/kernel/smp.c | 23 ++++++++++++++--------- arch/arm/kernel/smp_twd.c | 9 ++++++--- arch/sparc/kernel/time_64.c | 28 ++++++++++++++++------------ arch/x86/kernel/tsc.c | 31 ++++++++++++++++++++----------- arch/x86/kvm/x86.c | 31 ++++++++++++++++++++----------- drivers/cpufreq/cpufreq.c | 19 ++++++++++--------- include/linux/cpufreq.h | 2 +- 7 files changed, 87 insertions(+), 56 deletions(-)