Received: by 10.223.164.221 with SMTP id h29csp1969470wrb; Thu, 2 Nov 2017 03:57:57 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RjqoGySD88+60xK3fbRrltxPx1SwsVIOUx1tlnetZ8IwHuZ7MfO8+h/4s++GK0qZwc6UZa X-Received: by 10.84.130.34 with SMTP id 31mr2754645plc.241.1509620277094; Thu, 02 Nov 2017 03:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509620277; cv=none; d=google.com; s=arc-20160816; b=yVlM/tPAZVANRbfz7zcdKmP5M6Q9jiBN0PiiTmegeSD1SmztqT5k7i8pIYZeBznb// UeAskD027QPAvaoJAY5Tx45xl7qsZ3+uraDJiMuZEin9be0AkidH5WqLsaDB0lkCEoyD A2CKf+6TJEMYTAGI/uI/8/iS2gV6PAgmIp2UdKaVg4cPcu49xYzaFb9z9hCE3ONnz6AP Ra9Jz4WrcPgAELsAeUQEQC4hxYrsB/7/Ex2GiUdhGs8E6t30RCi6UOrVkclOEQS9cd3u V8kk4utG+RGLXLV4qeFnrAAzjLS8zDM+qiFz/Um+F1nbMuwGdbIND5uTQQBIGbWH4MQu 8jvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=FcCBxVKv8evehirHRHx8xZ+UsaT2XOGNGPlHN95Jqog=; b=l3eEjxPo9B/N2gA5RaTh1dUzObQTxnI03SzwXCT9uEXMJIAvjmI6I01vhABH4be7+1 XCrXtNC7gNhpOuBDnRLdEckdedIpMOdAkTWyTG6V5FIoYKmwARAxPUOi2OQR1JzsRDwX bmB2Zob+pzIiFECE3AGQPO4qd+UHwoiciTIJ9J7HZNAflNDsO5H4foBKeyDqBSA9WqSt sGE1iQcCzmDu94XBpqRqjMdO2tqsqoL9TbRRaYkaSkpg7zxHCs4ZfGbkWvPrBwgPioVu 9UQtNDUEwtu9Rp73rTjuYUPChOTC2NIQQBsvpC3PSVXy9C/MY+Ycb6QHgp9TtZnEi+MO tDPA== 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 f64si3497268pff.49.2017.11.02.03.57.43; Thu, 02 Nov 2017 03:57:57 -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 S1755698AbdKBK4f (ORCPT + 99 others); Thu, 2 Nov 2017 06:56:35 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:57924 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755529AbdKBKy5 (ORCPT ); Thu, 2 Nov 2017 06:54:57 -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 95C3D1435; Thu, 2 Nov 2017 03:54:57 -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 C9BFD3F3E1; Thu, 2 Nov 2017 03:54:55 -0700 (PDT) From: Chris Redpath To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: morten.rasmussen@arm.com, dietmar.eggemann@arm.com, Chris Redpath , "Rafael J . Wysocki" , Viresh Kumar , Ingo Molnar , Peter Zijlstra , "4 . 9+" Subject: [PATCH] cpufreq: schedutil: Examine the correct CPU when we update util Date: Thu, 2 Nov 2017 10:54:38 +0000 Message-Id: <20171102105438.14258-1-chris.redpath@arm.com> X-Mailer: git-send-email 2.13.1.449.g02a2850 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since: 4296f23ed cpufreq: schedutil: Fix per-CPU structure initialization in sugov_start() We lost the value of sg_cpu->cpu which is assigned during sugov_register. The memset in sugov_start overwrites it with zero. This leads to always looking at the utilization of CPU0 instead of the one we just updated when we do a utilization update callback. Let's fix this by consolidating the initialization code into sugov_start(). Fixes: 4296f23ed49a ("cpufreq: schedutil: Fix per-CPU structure initialization in sugov_start()") 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 Cc: 4.9+ --- 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..eeb7e0a1d861 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -731,6 +731,7 @@ static int sugov_start(struct cpufreq_policy *policy) sg_cpu->sg_policy = sg_policy; sg_cpu->flags = SCHED_CPUFREQ_RT; sg_cpu->iowait_boost_max = policy->cpuinfo.max_freq; + sg_cpu->cpu = cpu; } for_each_cpu(cpu, policy->cpus) { @@ -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 1583368621020438035@xxx Tue Nov 07 01:26:27 +0000 2017 X-GM-THRID: 1583368621020438035 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread