From patchwork Thu Jun 29 05:26:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 106607 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp704259qge; Wed, 28 Jun 2017 22:28:37 -0700 (PDT) X-Received: by 10.84.128.102 with SMTP id 93mr15804782pla.21.1498714117150; Wed, 28 Jun 2017 22:28:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498714117; cv=none; d=google.com; s=arc-20160816; b=Pa6GkVzv8tfFEqKbQn9qJUKgOiFHjExAbxVAOHpMJ5wBfODDwJaCOi30MiC6WFkLbz 8jXT6yhFh5IfdYtuHV5K9IywTPiAeq2ovkgk2k6yTv8C96ATERquik6RtZGY9UbIIo/9 bpjTPgQ+x2FsGtrsZue+DaqKaRt4bW2ToAmy88Nx8CSIbas1KCjLPaLvoxY/ArT+odlX uxl0ESd0h/OJ7dYrr5dvJhmeI3o7rgrnZ1B+4ssSrNpqAqUXR5ObCuqwDBRkeMszx4/z 4vH1LExoBT1j5b5giqoV0+9bA3S/b+OVJ9yR02SyR5PiYYEiliKYbSjzc7XBmW+Xx+s6 X/GA== 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=wmP5Q5X+JSJ0vDsGUnlfJGfRlwEng18Xv9V32BkrYps=; b=Tr24znq1CqWz3pOLDNhIxigLMmN7aY0hSDzvxNjXmDDb7ywX4KBXN3wvvqiUBOam2W xN6FiOgGSy5ld2NoxHc31zJXMTk+e1OucSubAenh/wF4hFA2B6uqLrGtu0m1Z7lpFsqY wVScNkZwx+SGU9BDaXVbU9YIQU58sSPROhdIKy5OZ+guig1ByNWKphEyK0rJaxXIcsAn NHkztXvU8GIx8g6Y40kW3VrWyEee5bPTy8PuHJmWPwGJ2Zsk2hio0B+80b8tieYx16kd dCY4glN97cln29PDEIQUGQ1mj+/aEGBOIl3Vi7k5EJG0D6bbMNJFSSMQ59cMN+k+UXxz JlOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=W1TJvEdf; 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 206si2969952pfb.354.2017.06.28.22.28.36; Wed, 28 Jun 2017 22:28:37 -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.b=W1TJvEdf; 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 S1751747AbdF2F2e (ORCPT + 14 others); Thu, 29 Jun 2017 01:28:34 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:35337 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850AbdF2F15 (ORCPT ); Thu, 29 Jun 2017 01:27:57 -0400 Received: by mail-pf0-f169.google.com with SMTP id c73so44560181pfk.2 for ; Wed, 28 Jun 2017 22:27:57 -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=wmP5Q5X+JSJ0vDsGUnlfJGfRlwEng18Xv9V32BkrYps=; b=W1TJvEdfhNRKlFrqqik9sAuSOZHPmhoLlNp6uWEL+SIVDItXCgLWI0Z4jeh2cxKSwX sC6prRZpKP4LG7NAYDn3/Sqnk09Jz6aQsvCNBZvy8H2xfefDFxQ8rDU8KwYcwo8CoNyU c0qeDrTc4iWCEqYNXhna6g3dOc659Rd0242Ss= 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=wmP5Q5X+JSJ0vDsGUnlfJGfRlwEng18Xv9V32BkrYps=; b=fRfU0rY6RqIc7FnBCFlfh5aZhB8wmBpXmMh/9/KEyukG8wo79cnmx28ONQjq8J+9jq PnglES66GIKJLpGHRkEz8JQa0FAr1R8YJtrGv8DimyXNfvHDapOIYZCKZ5fmmIy8aCY5 B2ikEidxpVd/Txwoh1pbP2Xi2Eqg/HYUE9NQpqRB2lG/msw/M9+g8jhP/g6HfjeLN7Qt +bpwpGC1oAbxXdgqW0xGijRUADlYopynJ7L4HMKtXBRm+117wEDwBopkJhxc1Kij4iVu AjmsCA+I9J55bdjj5Y02ifFD6f3dxw5SD/XLsY0Q0HWhpGwrNfSZm1LDw42+Tt4WYS6U joQg== X-Gm-Message-State: AKS2vOxfRRdPZXCR5YM+u0R21DYF2Ndl8CCfFQo0x2YprD+yxx58GdLM rxDKoVuKwuXrFlUg X-Received: by 10.84.233.204 with SMTP id m12mr15921007pln.292.1498714076534; Wed, 28 Jun 2017 22:27:56 -0700 (PDT) Received: from localhost ([122.171.238.149]) by smtp.gmail.com with ESMTPSA id l63sm9183933pfc.132.2017.06.28.22.27.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jun 2017 22:27:56 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Ingo Molnar , Peter Zijlstra Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org, smuckle.linux@gmail.com, juri.lelli@arm.com, Morten.Rasmussen@arm.com, patrick.bellasi@arm.com, eas-dev@lists.linaro.org Subject: [PATCH V2 1/4] cpufreq: schedutil: Process remote callback for shared policies Date: Thu, 29 Jun 2017 10:56:30 +0530 Message-Id: <643fe4ad707e3b02336ecf069e7f022d770bec98.1498712046.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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This patch updates the schedutil governor to process cpufreq utilization update hooks called for remote CPUs (i.e. For updates to the runqueue of other non-local CPUs). For now, we only support remote callbacks for CPUs which share their cpufreq policy with the local CPU. It may not be worth allowing remote callbacks in other cases, as we wouldn't be able to update the frequency on local CPU in that case. The schedutil governor already has proper locking in place for shared policy update hooks. This also adds a new field "cpu" in "struct update_util_data", to identify the remote CPU. Based on initial work from Steve Muckle. Signed-off-by: Steve Muckle Signed-off-by: Viresh Kumar --- include/linux/sched/cpufreq.h | 1 + kernel/sched/cpufreq.c | 1 + kernel/sched/cpufreq_schedutil.c | 19 ++++++++++++++----- 3 files changed, 16 insertions(+), 5 deletions(-) -- 2.13.0.71.gd7076ec9c9cb diff --git a/include/linux/sched/cpufreq.h b/include/linux/sched/cpufreq.h index d2be2ccbb372..8256a8f35f22 100644 --- a/include/linux/sched/cpufreq.h +++ b/include/linux/sched/cpufreq.h @@ -16,6 +16,7 @@ #ifdef CONFIG_CPU_FREQ struct update_util_data { void (*func)(struct update_util_data *data, u64 time, unsigned int flags); + unsigned int cpu; }; void cpufreq_add_update_util_hook(int cpu, struct update_util_data *data, diff --git a/kernel/sched/cpufreq.c b/kernel/sched/cpufreq.c index dbc51442ecbc..ee4c596b71b4 100644 --- a/kernel/sched/cpufreq.c +++ b/kernel/sched/cpufreq.c @@ -42,6 +42,7 @@ void cpufreq_add_update_util_hook(int cpu, struct update_util_data *data, return; data->func = func; + data->cpu = cpu; rcu_assign_pointer(per_cpu(cpufreq_update_util_data, cpu), data); } EXPORT_SYMBOL_GPL(cpufreq_add_update_util_hook); diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 076a2e31951c..3f9cae9ab326 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -154,12 +154,12 @@ static unsigned int get_next_freq(struct sugov_policy *sg_policy, return cpufreq_driver_resolve_freq(policy, freq); } -static void sugov_get_util(unsigned long *util, unsigned long *max) +static void sugov_get_util(unsigned long *util, unsigned long *max, int cpu) { - struct rq *rq = this_rq(); + struct rq *rq = cpu_rq(cpu); unsigned long cfs_max; - cfs_max = arch_scale_cpu_capacity(NULL, smp_processor_id()); + cfs_max = arch_scale_cpu_capacity(NULL, cpu); *util = min(rq->cfs.avg.util_avg, cfs_max); *max = cfs_max; @@ -218,6 +218,10 @@ static void sugov_update_single(struct update_util_data *hook, u64 time, unsigned int next_f; bool busy; + /* Remote callbacks aren't allowed for policies which aren't shared */ + if (smp_processor_id() != hook->cpu) + return; + sugov_set_iowait_boost(sg_cpu, time, flags); sg_cpu->last_update = time; @@ -229,7 +233,7 @@ static void sugov_update_single(struct update_util_data *hook, u64 time, if (flags & SCHED_CPUFREQ_RT_DL) { next_f = policy->cpuinfo.max_freq; } else { - sugov_get_util(&util, &max); + sugov_get_util(&util, &max, hook->cpu); sugov_iowait_boost(sg_cpu, &util, &max); next_f = get_next_freq(sg_policy, util, max); /* @@ -287,10 +291,15 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, { struct sugov_cpu *sg_cpu = container_of(hook, struct sugov_cpu, update_util); struct sugov_policy *sg_policy = sg_cpu->sg_policy; + struct cpufreq_policy *policy = sg_policy->policy; unsigned long util, max; unsigned int next_f; - sugov_get_util(&util, &max); + /* Allow remote callbacks only on the CPUs sharing cpufreq policy */ + if (!cpumask_test_cpu(smp_processor_id(), policy->cpus)) + return; + + sugov_get_util(&util, &max, hook->cpu); raw_spin_lock(&sg_policy->update_lock); From patchwork Thu Jun 29 05:26:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 106604 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp704005qge; Wed, 28 Jun 2017 22:28:09 -0700 (PDT) X-Received: by 10.99.119.198 with SMTP id s189mr13833203pgc.32.1498714089065; Wed, 28 Jun 2017 22:28:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498714089; cv=none; d=google.com; s=arc-20160816; b=pZe+k2txygPhbFjSgNjitNJZdNCCl5YN70tdAGbKvqgsQjUhKV4fTnfktKGJazo4+b Nao0DJsR/zVp8F3YIU4p6Lds3DbAvMkgc86uNXtIFbsb7k3kSHpqU3P08c7vvRcqeWl9 yaxbAIOIiGQ/xTaW5mkCaqIFUTsHPtKwee9GW8gb30zyzyGdRTa+ep6pripVEf6w3YLw W42riEdxOvyvN0k+iP/rXlrzzY+ehFJ+U7wDSN+BUEiYUFZKrqhxywvu1InjSSphJDA4 0EQloVF4Rji3jIBz/7+JTbKqinzPd/dot6nZFjgLV/K9nf/LvmSw8W8Sf2MNPGMGFu2j 62Ew== 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=suJX4jpvnY27qyC2MbUcO33HPa2ywrjUQqBDc0z23xQ=; b=R2Q6hhnZhc03wwUVlLPGG2w2+RzebyV+IesG80eiuc8xJ3uqJeVLS2UqnZmjGrAcbW wzCDoqQ8juv8FQZT3SDU9wA4VM9uJsrATWfSgpC4tkRqhPIMxmyD+G6KIIR4pQWwf09j ccP9bg3x1YAGUtgTAgd1ui5blxcVpbrpk3IL92s2jh6SBd8Zg7BzJ5r+xSKD0KkuQ72r 03kcCLEREYX09csWOn1VKhp9peOLKVMsiJ+uX7guhwos6d7DZonSJfhN/86H3tqebwiG 3LVf4rxkR+ZQZ7agZHLEodESEZAVagoikQcV5FUD6Qc+JJXWtP9iaw1pzHYaOBxT4Zoq A+1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=SbbAdZ1L; 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 l30si3223664plg.391.2017.06.28.22.28.08; Wed, 28 Jun 2017 22:28:09 -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.b=SbbAdZ1L; 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 S1751681AbdF2F2H (ORCPT + 14 others); Thu, 29 Jun 2017 01:28:07 -0400 Received: from mail-pg0-f52.google.com ([74.125.83.52]:36582 "EHLO mail-pg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751893AbdF2F2A (ORCPT ); Thu, 29 Jun 2017 01:28:00 -0400 Received: by mail-pg0-f52.google.com with SMTP id u62so42283863pgb.3 for ; Wed, 28 Jun 2017 22:28:00 -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=suJX4jpvnY27qyC2MbUcO33HPa2ywrjUQqBDc0z23xQ=; b=SbbAdZ1L5kRMjkQiKqGbC2e4EmJeDBqbKjEiitNGFkJp+6pd8NXWIeCymi3obXjhEe keIJBTXdewQ4r4CpKtqOL7q+JdCHZ3Tbx0YWVusWx8ADTlwdO2t0k53TEa/qzj5jutDD +JkUYYMgXPDMFreGyytClotavPVtcBW911a9c= 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=suJX4jpvnY27qyC2MbUcO33HPa2ywrjUQqBDc0z23xQ=; b=SLagAFg9CKmrw+EWdDPLkkSoOW2pOncyspFxQGd6vKBkwTGsa4ESB0Au9dgp1fzpVc pg+R5zMlMN5QDjan+lTLGfTnakLphJUbkheZzPMaav7s1HMxemJKTADuJOo5dngKqOCH r6Du8qe+eRCAEQWe6a7VPdT/pF9Q5Gbv1DqnXS+REqiPnCDTmNc6YLhiyTCQk6+tooiR UsyN6umEjE5ZVXaQbKtjO8JMQiKK1vOchdx1EetCh6k+JYzY0GQpshTUEC+CmNlnP5Io 3wbL4Qa/BR2q2pIlou+fntpRSSLttM/fwtNNjH8+72pEU2JZeIWoJKArejMxpQ0zZML+ TqRw== X-Gm-Message-State: AKS2vOyJVMoamRzbHbR748M1kpDnOlQU7Jg2UteoOgHvGro0/P9sk4o9 3gGFZUMwQmZvJil6 X-Received: by 10.84.132.106 with SMTP id 97mr15824761ple.234.1498714079495; Wed, 28 Jun 2017 22:27:59 -0700 (PDT) Received: from localhost ([122.171.238.149]) by smtp.gmail.com with ESMTPSA id v17sm10037561pgn.4.2017.06.28.22.27.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jun 2017 22:27:58 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Ingo Molnar , Peter Zijlstra , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org, smuckle.linux@gmail.com, juri.lelli@arm.com, Morten.Rasmussen@arm.com, patrick.bellasi@arm.com, eas-dev@lists.linaro.org Subject: [PATCH V2 2/4] cpufreq: governor: Process remote callback for shared policies Date: Thu, 29 Jun 2017 10:56:31 +0530 Message-Id: X-Mailer: git-send-email 2.13.0.71.gd7076ec9c9cb In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This patch updates the legacy governors (ondemand/conservative) to process cpufreq utilization update hooks to be called for remote CPUs (i.e. For updates to the runqueue of other non-local CPUs). Based on initial work from Steve Muckle. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq_governor.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.13.0.71.gd7076ec9c9cb diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index 47e24b5384b3..0b49fc8bb91d 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c @@ -275,6 +275,10 @@ 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; + /* Allow remote callbacks only on the CPUs sharing cpufreq policy */ + if (!cpumask_test_cpu(smp_processor_id(), policy_dbs->policy->cpus)) + return; + /* * The work may not be allowed to be queued up right now. * Possible reasons: From patchwork Thu Jun 29 05:26:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 106605 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp704021qge; Wed, 28 Jun 2017 22:28:11 -0700 (PDT) X-Received: by 10.84.217.139 with SMTP id p11mr16016940pli.214.1498714090967; Wed, 28 Jun 2017 22:28:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498714090; cv=none; d=google.com; s=arc-20160816; b=tWrfeufmZ8QxfByg/PjTyd7zT71xR3OnE/rjsiEdEY3hPzHmt3JGxB0uAtRzTWpGEX T4xgN95NSjZmIQ2hfGxKd13JuXKH1XPpSffyjk0589GDY2+CKJkdw3aWeapRR1hQH2wN wPqjl9W0pAS3w0PuDim/QUmPBQENv3tMCW/M9VWxxlSeZG6WpOja4mwxs2h3Wuhhge8R Bc5JUmXBfxdijSXFEq5KvfLzIc6CQHSsOfuoL4jPZCCxPinp4mesYVJ8I+pvvJevsoUS Svay5KQxJf2oYr5AyVMdxFBXIkshH93sndMM3UzRNGnf0DqDlMWXPnh0aSsprXuuO5eH C/uQ== 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=R84SDfhnTe/nTsYHL/GHU6y2POz9jSy0VNvFAyqIu3A=; b=H4w5OV09RO21g/j5k86Vy/qe9OwoaJDlUxWsJFy1evLTUlhqu1BbMu6UqcIFazG2vJ WfbJVCYV4dQ12/FqRku/hraRegWlE3itXZ/tqmqLioWZ5Md/sBpVTGd+n96QYi9DM9bS QnmAv9C4AL/M/Rn/U3/bAExTk6Dtqg5Bg1V39uA273Z0irCfgcNAHTTpE2byihVXBPAL j/HeqEZweraIAIe/LsAW1uTRvpHa7qJKpv9iD7uWXGGxF3NpEKdBuuLVfOFtd3Hei6oY hgGPNuRXPGKihKcPxa8oo6pu8PigmQSM/DVnO6B2/jeay3khZ2AvndfbtgqOuSQqLefa T/0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=h0hf63EU; 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 l30si3223664plg.391.2017.06.28.22.28.10; Wed, 28 Jun 2017 22:28:10 -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.b=h0hf63EU; 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 S1751973AbdF2F2J (ORCPT + 14 others); Thu, 29 Jun 2017 01:28:09 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:34714 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751927AbdF2F2D (ORCPT ); Thu, 29 Jun 2017 01:28:03 -0400 Received: by mail-pf0-f170.google.com with SMTP id s66so44500641pfs.1 for ; Wed, 28 Jun 2017 22:28:02 -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=R84SDfhnTe/nTsYHL/GHU6y2POz9jSy0VNvFAyqIu3A=; b=h0hf63EUbzpYnB68hjr3bblkdclBjHZ15PIaCJ/gTZSaBu14vsTxK9ufpYQEt4pQtk SX/zGBTzrL8jzKOImEgGhSGYIogdJrt4/W9lnFzo6K71Ktn7KsYbOX70VHUNo+c07SvY 3Ty/4CECjTJgLOBPfO4Oga8LTllJUof82hpPg= 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=R84SDfhnTe/nTsYHL/GHU6y2POz9jSy0VNvFAyqIu3A=; b=EFUj4oFlBLaxeu66TiFnWvps6MpLdnTnUVufmfpsqUciwY55v0WGvD9dreuQDEKXVJ a3luDeo+eNQYG99Ey24x2eY2jN2NZVawXCnEWgriXIr/h2BXB5i/hvPu28D7OBkK6iek diS1uUN8HdS1chNVnh450upxIBdrZcfHF1Rs2ZhU3EDpXN17Xc6GETUMUqVp37oba+Lr dBnSaA5/XuhTH4gGI+8PZfQyXOzphyYbXv4HByVStfL10cIjEy80dwvItoJBix+Qlilc 385K9NHye64KLQxrymtbetN9cTDe598C2TRSTFDCi4e4egkHOLamOEhJuoqR/AgHPfIb WjTw== X-Gm-Message-State: AKS2vOw0s7FHGmOcyy2MTkLbVrJRX++M9zkOGKh+OSm2QRV04Yku9FGM A6cH12ZAFLZJvG3G X-Received: by 10.99.171.66 with SMTP id k2mr14189994pgp.248.1498714082313; Wed, 28 Jun 2017 22:28:02 -0700 (PDT) Received: from localhost ([122.171.238.149]) by smtp.gmail.com with ESMTPSA id b7sm9822944pfl.44.2017.06.28.22.28.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jun 2017 22:28:01 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Ingo Molnar , Peter Zijlstra , Srinivas Pandruvada , Len Brown , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org, smuckle.linux@gmail.com, juri.lelli@arm.com, Morten.Rasmussen@arm.com, patrick.bellasi@arm.com, eas-dev@lists.linaro.org Subject: [PATCH V2 3/4] intel_pstate: Ignore scheduler cpufreq callbacks on remote CPUs Date: Thu, 29 Jun 2017 10:56:32 +0530 Message-Id: X-Mailer: git-send-email 2.13.0.71.gd7076ec9c9cb In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Steve Muckle In preparation for the scheduler cpufreq callback happening on remote CPUs, check for this case in intel_pstate which currently requires the callback run on the local CPU. Such callbacks are ignored for now. Signed-off-by: Steve Muckle Signed-off-by: Viresh Kumar --- drivers/cpufreq/intel_pstate.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.13.0.71.gd7076ec9c9cb diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 4ce501148790..7a2a8ee579ef 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -1755,6 +1755,9 @@ static void intel_pstate_update_util(struct update_util_data *data, u64 time, struct cpudata *cpu = container_of(data, struct cpudata, update_util); u64 delta_ns; + if (smp_processor_id() != data->cpu) + return; + if (flags & SCHED_CPUFREQ_IOWAIT) { cpu->iowait_boost = int_tofp(1); } else if (cpu->iowait_boost) {