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: 160309 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15145116jad; Wed, 13 Mar 2019 23:43:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIJGYNHHw39Svxwl32Q+2rmF8T65YgzkPwiAwHWm7VOEfh9yr6VQY5FEr9/w0IWVtBAvnB X-Received: by 2002:aa7:8051:: with SMTP id y17mr47561212pfm.92.1552545798619; Wed, 13 Mar 2019 23:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552545798; cv=none; d=google.com; s=arc-20160816; b=036cBD+HtSGeHU4mplAvBNo8cRjUI4H6sOpb3feurvpDBbjDc7gIOzDB3vcxSvkMlq tdghy6DNDwUm7FPvKwzNpFKOE1PIxNq0qj4M7Dci6uEPBnOgGTYNzXty+2l/YIROetEY fJnfvDzfhhAgH9jQ3Ej7TE2XfB5MOy3BUgNnAWa6RSiLtG0NmFR5hZo/P+8+Mvcb8FpV i5xr0sd2uVUnBmsaxc1807BVsgZtQkhYFLyw47+f7p3Lupe2qznWFh3oQLxnRX4FaryR ScCwHS1epHhSfOy/VfBb4ZbqXqan2+yImOeroitcNXeOij80pSkP2Ws9UEP9V/bpoSux utAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=5+5Cw5z33DIg1su6ZAUGhXXSsFuNvEeeUI9Xv45/m58=; b=QlpngGyQUccnUsL/KLcAjasjHp41c9syhEKcNZuxbalUb58aRdl1EMGVYf680Y+u2a KBaxt+WD0p5++pMQmQ8MihKZnbud1XnW4c1301LlXnzqiPs3VZh220wdUpwxKnlM+ypZ DQvUzYl6ZNWPm2SFo9yIpbz5W/5bqlkJZZiPQCY/EDnlPRWKzeWcwuS+yYDKXBaSvUx3 Rs07telGR1PKvWUjxeFHFJ8wITVtbsJIi9uTgLMLXh1uw6AokGxrOWdX+iKi6Imwf6u2 QPhKVTcsbJKNkKw5AnpgwhbkIanfYRWkWvstpi+yIrwMQPX3jJGPWtkN/+ZACa7coOhy WfCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=choj6QuS; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m20si11627402pgv.136.2019.03.13.23.43.18; Wed, 13 Mar 2019 23:43:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=choj6QuS; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726886AbfCNGnR (ORCPT + 11 others); Thu, 14 Mar 2019 02:43:17 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:33624 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726654AbfCNGnR (ORCPT ); Thu, 14 Mar 2019 02:43:17 -0400 Received: by mail-pf1-f193.google.com with SMTP id i19so3201046pfd.0 for ; Wed, 13 Mar 2019 23:43:16 -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=XBtz3QAovoSHfIfgLt2FOtAtRK29bf6Q8o4kNlwO19OdHRefWjqrkENjLYIdJSkqFa 9SL/rd3PK/w6/gNbpOL5M8MTkfMBo6nlBWxWHlqhgwdfKAOTAinADtmmCoco3nDGwnuK ekuR45Mzh4o1PudRp1Uhw9DzsICV7kFGivq2HDcv6VB29j8/pav63v8Tcv2E20hODCYO A3u0H1sfbtFIaNGg3Lc9hm45QwIM1A8dEZN0Ptmu01wncHnFsldQXBaXd/8EIVH5EPFQ ety3Zx+dnGjYE2bjzOvxHWjtYepv/bllp7QBK74CNPdp2/+9rf6Jp6hPgAxDc9h8TeJB td2Q== X-Gm-Message-State: APjAAAUnqnaF90tDiU2JI6cLcZRttxm9n2AF9AxA1fHWqC1QEMPVg6zL AolFjbnD5bd10yKTxgn6RQ2C+g== 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 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 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 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: 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 Acked-by: David S. Miller