From patchwork Thu Jul 13 06:44:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 107552 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1830721qge; Wed, 12 Jul 2017 23:45:20 -0700 (PDT) X-Received: by 10.99.109.201 with SMTP id i192mr7820203pgc.204.1499928320050; Wed, 12 Jul 2017 23:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499928320; cv=none; d=google.com; s=arc-20160816; b=XND+c8sFADDPzh+ivF8lncr4apg+oBn0YrpIIadciEqUoxPBv8RJscqOqciPJ1ahcy 5OQsVhU2gRwCtB+pByxAeumXR1/EYU44QbHgWJjtL3WBaBfUvzkPZbz9zsr53pHmP1L3 0Z0FLe5muLP3p9R37ge5YnnEOgwe9ctOS3pbFFrphSraKhHf0PSPM/urj8Oc3MRf/M5a 6sC+2R4ibWcjB76t6VHm/mvN9UsfRwcIA3mfjoO7q2eEnaV3SqlBv0qifyTgSP0Q9ClT ornWltqXRsp/vzNBvKzu6dksowbcykOKnOs8snHdQdTUGZ3dWQrGUzNWQ8kUr2QVp46r JJTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=utGWZXaPt88H9hR02yWNRjlbalVN6rT2tBZbiutiWFA=; b=VB+ihWyA1mgp42ZIyVZ0lx1FVVt7f+Tz6aDfjYGsbzfMpvMtm5eBn6T3J6kAoY5dVB PvZVSdEVQKmnt/Ar3xE1flng4aBoMt65yTROrrueQTpCvqYGHoYDMvI0n7UpTyOcqt7v 7NJBMNQ3/CbuzuzOgNMcYPbMBPDoBUaXtzk5NYq3yXqtsaCKrZqlaqPztw4WA8MvvfB1 EwKtyYc8yOSIamoiulBx2kJot1Zz/bmDV6Y0GAbHO3R5PV+FEBzvgzRzCdjzIzFmKRip Hg0DgbX2qM60ov/K2Qxw9NhOS9J+OlVEbRpbgIQ/XpAUnxhzDahwwRi89tKzbKthRkg/ D5yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=ZXzfIe+8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 k124si3705765pgk.434.2017.07.12.23.45.19; Wed, 12 Jul 2017 23:45:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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.b=ZXzfIe+8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1751275AbdGMGpR (ORCPT + 25 others); Thu, 13 Jul 2017 02:45:17 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:35488 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751198AbdGMGpO (ORCPT ); Thu, 13 Jul 2017 02:45:14 -0400 Received: by mail-pf0-f181.google.com with SMTP id c73so24726367pfk.2 for ; Wed, 12 Jul 2017 23:45:13 -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:in-reply-to:references :in-reply-to:references; bh=utGWZXaPt88H9hR02yWNRjlbalVN6rT2tBZbiutiWFA=; b=ZXzfIe+8pJkSJktWvLaaPfjyOgR7pGSzbuzWkG840dtL7zzkMYFeHZ876dt+9OMjWs pPeD4I5I+yPLcIRAo63qjA29FcTknUgDKc6qDazRou6qdrTr6e+qobL6HjEHUue6+eOh z5mE9YYFKqMC+ve2uT1ncJ3YKXz4iLEu2HEbs= 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:in-reply-to :references:in-reply-to:references; bh=utGWZXaPt88H9hR02yWNRjlbalVN6rT2tBZbiutiWFA=; b=Q4IFyMgqlAqtMW1EUIjponZcg6HDJHjh6VhNSTO3quUqydXRcR/8Wl3e5amTZBvdqY fXv8dcXUftHjnvkqaifX6yAnSJvHF1N1aR42I9HSen48YJzRgmEgSwN1IHqw44DWG5/p ZJUAoyGdX2fpUf9v+pb57OTkAQwNvArkXZBP5AuV5+q17LmsmakQQSNxQv6uVa7KQ8rq TMnh/5FbtEbULSRGCeWoeosI+q/MKrQ3WcKeGXLToHPwBh6wiUjIqE26D5cE3z5MFWBm e4LApJl964mwDNN5G5911fBC13c6uXsE75ESJo/3Z5IMT7258cNRyLaX2KUGrgXaT4w0 VoQQ== X-Gm-Message-State: AIVw113uA0nq3jfc7d/I4YbOUxQcv0fZkVhe2ILR4aLfJbJi9rd38TpE d6lNMAlDYoUZ/uVS X-Received: by 10.98.133.211 with SMTP id m80mr59782860pfk.164.1499928313418; Wed, 12 Jul 2017 23:45:13 -0700 (PDT) Received: from localhost ([122.171.81.230]) by smtp.gmail.com with ESMTPSA id b13sm9482479pfc.25.2017.07.12.23.45.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2017 23:45:12 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , smuckle.linux@gmail.com, juri.lelli@arm.com, Morten.Rasmussen@arm.com, patrick.bellasi@arm.com, eas-dev@lists.linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 3/3] cpufreq: governor: Process remote callback for shared policies Date: Thu, 13 Jul 2017 12:14:39 +0530 Message-Id: <93a9001437dac267e083f4df55f68bd2e2455d47.1499927699.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.13.0.71.gd7076ec9c9cb In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch updates the legacy governors (ondemand/conservative) to process cpufreq utilization update hooks to be called for remote CPUs. Proper locking is already in place for shared policies and nothing extra is required to be done. Based on initial work from Steve Muckle. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq_governor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.13.0.71.gd7076ec9c9cb diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index 606b1a37a1af..0b49fc8bb91d 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c @@ -275,8 +275,8 @@ static void dbs_update_util_handler(struct update_util_data *data, u64 time, struct policy_dbs_info *policy_dbs = cdbs->policy_dbs; u64 delta_ns, lst; - /* Don't allow remote callbacks */ - if (smp_processor_id() != data->cpu) + /* Allow remote callbacks only on the CPUs sharing cpufreq policy */ + if (!cpumask_test_cpu(smp_processor_id(), policy_dbs->policy->cpus)) return; /*