Received: by 10.223.164.221 with SMTP id h29csp124608wrb; Fri, 3 Nov 2017 06:37:45 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TTZu2RQvlxOUXwHb4HDEJjBI5SM3G5r0N0jellxE/R9BLxO0ZA75F/rAzfwq2nsiGS1t8H X-Received: by 10.98.242.15 with SMTP id m15mr7860687pfh.176.1509716265599; Fri, 03 Nov 2017 06:37:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509716265; cv=none; d=google.com; s=arc-20160816; b=t3jfwlLJTCXjdIOj5LyNxGxunoxSP65WEYB2Z7uPMBU0P61GAelABon9NYtAnbs0K/ vXqXpIniE7Jt9kkmGjm11/IFfEpktqzeJnEttHfI5hDYfR9tZZaVcoHXAIAvQ8a8htDD UarFswefNEaFPV9GTZd9rI98DAD+Rxwg7T0KXCfU890oz5lO1vEjVdlDJ/c/a1x9VY16 hv3InuE3LpV++ooozf4zYPwho84jX8u5YzLdBkWZpBrrq/3Ka46yuV/3MzWFQiQR2HZ0 jGdFYuCR34xLeTdJ1UIXn1g/OfTuIPmdLfYWCl9WlT13bVp4npSH7yk4lWo9dtXcHDID xMNA== 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:message-id:date :subject:cc:to:from:arc-authentication-results; bh=J5K2vZSNB7aq474/zxyumIBVp1VUXWyLMXqKKxxXksk=; b=IWvwWnbM738E/cNzTr4tUeMeKPb+EKn4vWT23OQea1S30aGKK1qwmB6jxO7UWR6okV CObFHaHjFMbsBuWLxjbUWv8qpchgFhYgPw2QEWC/TTriU9l9v79GkrOjzozuT6J5OjJB i9BxuqozkR+DECOJT0bjw7v9CmfvSrI/Q8Lz7NNORJhlSVSKRMjSG+ZCMZekh1R3GRGR RHIeaA6iOisKb03zotwUUVCa0ik3H98WBqvO5OThf8tyPoKAA/xc8QSjEQgMSIFr9Xkx 9je3CLjP5AkoEOaDPlsclNsiIF1ac+IcBnV1hwGVzCnMRztuG++iUt4j5SRfCf4wGAv2 dQXw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q15si1941357pgc.21.2017.11.03.06.37.32; Fri, 03 Nov 2017 06:37:45 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932954AbdKCNgv (ORCPT + 96 others); Fri, 3 Nov 2017 09:36:51 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:42968 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750857AbdKCNgu (ORCPT ); Fri, 3 Nov 2017 09:36:50 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3C9881435; Fri, 3 Nov 2017 06:36:50 -0700 (PDT) Received: from e108031-lin.cambridge.arm.com (e108031-lin.cambridge.arm.com [10.1.211.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 93A823F3E1; Fri, 3 Nov 2017 06:36:48 -0700 (PDT) From: Chris Redpath To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: Morten Rasmussen , Dietmar Eggemann , Chris Redpath , "Rafael J . Wysocki" , Viresh Kumar , Ingo Molnar , Peter Zijlstra Subject: [PATCH v3] cpufreq: schedutil: Examine the correct CPU when we update util Date: Fri, 3 Nov 2017 13:36:42 +0000 Message-Id: <20171103133642.8636-1-chris.redpath@arm.com> X-Mailer: git-send-email 2.13.1.449.g02a2850 In-Reply-To: <20171103034022.GD4240@vireshk-i7> References: <20171103034022.GD4240@vireshk-i7> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After 674e75411fc2 ("sched: cpufreq: Allow remote cpufreq callbacks") We stopped always reading utilization for the cpu we are running the governor on, and instead read it for the cpu which we've been told has updated utilization. This is stored in sugov_cpu->cpu. The value is set in sugov_register but we clear it in sugov_start which leads to always looking at the utilization of CPU0 instead of the correct one. Let's fix this by consolidating the initialization code into sugov_start(). Fixes: 674e75411fc2 ("sched: cpufreq: Allow remote cpufreq callbacks") Signed-off-by: Chris Redpath Reviewed-by: Patrick Bellasi Reviewed-by: Brendan Jackman Cc: Rafael J. Wysocki Cc: Viresh Kumar Cc: Ingo Molnar Cc: Peter Zijlstra --- kernel/sched/cpufreq_schedutil.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 6c1a7fcfa2a7..dc68a1ccdb33 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -728,6 +728,7 @@ static int sugov_start(struct cpufreq_policy *policy) struct sugov_cpu *sg_cpu = &per_cpu(sugov_cpu, cpu); memset(sg_cpu, 0, sizeof(*sg_cpu)); + sg_cpu->cpu = cpu; sg_cpu->sg_policy = sg_policy; sg_cpu->flags = SCHED_CPUFREQ_RT; sg_cpu->iowait_boost_max = policy->cpuinfo.max_freq; @@ -793,11 +794,6 @@ struct cpufreq_governor *cpufreq_default_governor(void) static int __init sugov_register(void) { - int cpu; - - for_each_possible_cpu(cpu) - per_cpu(sugov_cpu, cpu).cpu = cpu; - return cpufreq_register_governor(&schedutil_gov); } fs_initcall(sugov_register); -- 2.13.1.449.g02a2850 From 1583014719339569506@xxx Fri Nov 03 03:41:20 +0000 2017 X-GM-THRID: 1582951591518861812 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread