From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viresh Kumar Subject: [PATCH 0/7] cpufreq: Call transition notifier only once for each policy Date: Thu, 14 Mar 2019 12:12:46 +0530 Message-ID: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: Sender: linux-kernel-owner@vger.kernel.org To: Rafael Wysocki , Borislav Petkov , "David S. Miller" , "H. Peter Anvin" , Ingo Molnar , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Russell King , Thomas Gleixner , x86@kernel.org Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org List-Id: linux-pm@vger.kernel.org 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(-) -- 2.21.0.rc0.269.g1a574e7a288b From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viresh Kumar Date: Thu, 14 Mar 2019 06:54:46 +0000 Subject: [PATCH 0/7] cpufreq: Call transition notifier only once for each policy Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Rafael Wysocki , Borislav Petkov , "David S. Miller" , "H. Peter Anvin" , Ingo Molnar , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Russell King , Thomas Gleixner , x86@kernel.org Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org 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(-) -- 2.21.0.rc0.269.g1a574e7a288b From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_GIT autolearn=ham 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 6B240C10F06 for ; Thu, 14 Mar 2019 06:43:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2A7772085A for ; Thu, 14 Mar 2019 06:43:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZOn15XOZ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="choj6QuS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A7772085A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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-D3; 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?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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(-) -- 2.21.0.rc0.269.g1a574e7a288b _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel