From patchwork Wed Jul 26 09:22:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 108740 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp573056qge; Wed, 26 Jul 2017 02:23:44 -0700 (PDT) X-Received: by 10.99.177.78 with SMTP id g14mr269467pgp.131.1501061024223; Wed, 26 Jul 2017 02:23:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501061024; cv=none; d=google.com; s=arc-20160816; b=px7s9SJGG92Z+wYJ4Teq+47cHg4yTVbmfnkGDWmGTKYcluayJhmRa5NHY92k/gYOGn QwlVj25KvwWB8uWZzU+w9mkkS7W9a4NR2zYNPP1V7sRVUXV8roAa/TD2a0Kj9+u9Wuiw vnp8rBJ8l5O3ScrYs2tIoEB+B3TE8Fe3mYsFWSGXu0BotBjbb9VUWxJVpnez1QdS9oSt pVD6H9a3Txwms5liK8+nE9xfiEKYa6kFKPfGzYHPgoIaiG4YYzgkOySyYp2STswn8F2q KQzkkN6ii5vpk+UhCY6T2kUpTvZx9gVpJqWfg8ouOoOFkZ62PTmWBwn5idHcIkcrzFpV 6yHA== 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=bYMuHgyWhrhaTrRCgWddelfFOhfkUbm+sHIPzIWxAJY=; b=HCqJMSQfIPE/PtNYibqZhTAonz7RUsoa6/+w4eqMGaIKocmZ/MG1jSbxnR0IO+jx19 8eBKZKChmqCXJrksA/gHcPa7cAiY6DKeOaw9A2OMFZqOrOr0GYkSp8ufyy0uq6woGbds dxdGmao5UnYPpznqiU0hnYkF3kz0azuUhZuLgKB4z16WcUuXZk4rMphWPHvUGSLqCEqq r8XSMRbVl1rVdj7xzpduPV8e4tdD0xHOcDy25eT5iTiO0Y/U7426T+EdYXqd8gBkboa7 OrAyobUkNNn0EQ5srCbNxJeD/LJeyMKZmmYPzjysD2s/sgpUwaQom9U90xQLRzDcYEp6 lKqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Nr1TgvPS; 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 r63si9908697plb.589.2017.07.26.02.23.43; Wed, 26 Jul 2017 02:23:44 -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=Nr1TgvPS; 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 S1751568AbdGZJXk (ORCPT + 26 others); Wed, 26 Jul 2017 05:23:40 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:36813 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751503AbdGZJXi (ORCPT ); Wed, 26 Jul 2017 05:23:38 -0400 Received: by mail-pf0-f170.google.com with SMTP id z129so29293505pfb.3 for ; Wed, 26 Jul 2017 02:23: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:in-reply-to:references :in-reply-to:references; bh=bYMuHgyWhrhaTrRCgWddelfFOhfkUbm+sHIPzIWxAJY=; b=Nr1TgvPS0usgQyehRPcHAvmqyfuG23ZV4soraxGaMgPMj39GV80DRDH+bSMyeN27Cx tc1d4nTgmG/A+Pqhk/w7ZLxQj5HctQ68EZwgg4uhd3hR1JdvItXikrh8YBgz9hHmBDeN hYHE69sOQADxZ3Rgqatp90JQ4QFewYquj2Tl8= 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=bYMuHgyWhrhaTrRCgWddelfFOhfkUbm+sHIPzIWxAJY=; b=GdFJbGN1qndrorAYY0maKYKm87y/vbOQEjBb5hOdiSd4/J7YwMqFhz0rvgOEQRuhbG FAn8fO62PoeDi1uvi5gojJ3LTBSMtCcpnaJlHiRSYTc0GjjEto1sZ0m6dWlaWYseqQzp hhNGtDXnaHLhWWN62R323UnBxDynZ8hSLsGx8Ps25w6Knc7Q7b0FU/9/zZO3C5Q9PaK6 4TW2Ds9HhZcpJtAB9wOBcxmvjOiXXfa/nqEUPVwAbMRc152m/WW6eVrmSC+kjE2wupMV BIDn5BDLwR8EDfvbaHkUrf4h/awr/fmYPzXz6SCqixlyYJXSr8ViRXP86KiDDeRLORzW pqNw== X-Gm-Message-State: AIVw1116T4f0zPBkSDLC5A5365hhzSHetLM2Q5NcBoq+cFyITFIUO+12 hJXUz0ReK0GPeLix X-Received: by 10.98.215.74 with SMTP id v10mr259222pfl.314.1501061017692; Wed, 26 Jul 2017 02:23:37 -0700 (PDT) Received: from localhost ([122.171.79.89]) by smtp.gmail.com with ESMTPSA id f15sm31128824pga.5.2017.07.26.02.23.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jul 2017 02:23:36 -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 V4 3/3] cpufreq: governor: Process remote callback for shared policies Date: Wed, 26 Jul 2017 14:52:34 +0530 Message-Id: <36285b16e7c6a60613097ec8e258a9af2f6ab736.1501060871.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 5499796cf9a8..b1bf84149526 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c @@ -272,8 +272,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; /*