From patchwork Thu Mar 9 11:45:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 95113 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp318901qgd; Thu, 9 Mar 2017 03:46:19 -0800 (PST) X-Received: by 10.84.208.102 with SMTP id f35mr16776398plh.19.1489059979680; Thu, 09 Mar 2017 03:46:19 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h71si6247740pfj.139.2017.03.09.03.46.19; Thu, 09 Mar 2017 03:46:19 -0800 (PST) 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; 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 S932258AbdCILqR (ORCPT + 13 others); Thu, 9 Mar 2017 06:46:17 -0500 Received: from mail-pg0-f52.google.com ([74.125.83.52]:34431 "EHLO mail-pg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932319AbdCILqN (ORCPT ); Thu, 9 Mar 2017 06:46:13 -0500 Received: by mail-pg0-f52.google.com with SMTP id 77so25636906pgc.1 for ; Thu, 09 Mar 2017 03:46:07 -0800 (PST) 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=eyKUAP4yyOi+LO/YGRXc7QxqdF+1/ok+1sNn6WFHouc=; b=BFuU71TOxuX0Ue26k+ss7AnXbZ09qCHJIJkyGmlO6tEsdJgFGhtclLVcCy4UR0SqTn O0BxPqxb9TG+go98OGRi2/6gKLw4lWrlCad+KwcoiR7sbSXo6uhzSTbDZsoULuEWTH4l AiwvaJ5r6VEiZO6RwJhW6+5zd2uCIG0Lvx83k= 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=eyKUAP4yyOi+LO/YGRXc7QxqdF+1/ok+1sNn6WFHouc=; b=XsALv4kZYmNPWVh1tA8zI/f+KYV4ij7MN5Jplnic7wdiXWiDEv/S8GoFNq63u4h52P Vfx3WnvcxXszja4uNq6oLUr6uY2Yf5UNo66dG/870hUHQCo7gg2dnkkBvtgqrdLeEh9C AmulVaH1oKTbo1jIC+iX3FOTc2+o8swJd57HgkY4tDi16c2gqsdADrh5L69qZ5S+DXk5 Oea2rMRVbHz2a+b4meZbCuGzwBDRSdfy8iL06CfYT3XmbfqQ8W9pHUcn226tlKSC+b4m +3cJ6LGz06KBQ56WSX8ppdphntlk+gz9Vr4DEwz3XdiT6d9leZxDmh9O+McJksmZxnwR Lr0Q== X-Gm-Message-State: AMke39kXe47MB+pxjz0fTWbnoJCMjOYPwD90q/RhvPZnnS3BHrIH/EdbaW1ckF4Vkbf78cdM X-Received: by 10.99.123.1 with SMTP id w1mr13431561pgc.118.1489059967339; Thu, 09 Mar 2017 03:46:07 -0800 (PST) Received: from localhost ([122.171.239.200]) by smtp.gmail.com with ESMTPSA id 80sm12102975pfn.61.2017.03.09.03.46.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 03:46:06 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Ingo Molnar , Peter Zijlstra Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@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, Viresh Kumar Subject: [RFC 9/9] sched: cpufreq: enable remote sched cpufreq callbacks Date: Thu, 9 Mar 2017 17:15:19 +0530 Message-Id: X-Mailer: git-send-email 2.7.1.410.g6faf27b 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 Now that all clients properly support (or ignore) remote scheduler cpufreq callbacks, remove the restriction that such callbacks only be made in CFS on the local CPU. Signed-off-by: Steve Muckle Signed-off-by: Viresh Kumar --- kernel/sched/fair.c | 6 ++++-- kernel/sched/sched.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) -- 2.7.1.410.g6faf27b diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 3e88b35ac157..12db77814814 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3188,7 +3188,9 @@ static inline void set_tg_cfs_propagate(struct cfs_rq *cfs_rq) {} static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq) { - if (&this_rq()->cfs == cfs_rq) { + struct rq *rq = rq_of(cfs_rq); + + if (&rq->cfs == cfs_rq) { /* * There are a few boundary cases this might miss but it should * get called often enough that that should (hopefully) not be @@ -3205,7 +3207,7 @@ static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq) * * See cpu_util(). */ - cpufreq_update_util(rq_of(cfs_rq), 0); + cpufreq_update_util(rq, 0); } } diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 5cbf92214ad8..30c71fc3e02e 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1921,7 +1921,8 @@ static inline void cpufreq_update_util(struct rq *rq, unsigned int flags) { struct update_util_data *data; - data = rcu_dereference_sched(*this_cpu_ptr(&cpufreq_update_util_data)); + data = rcu_dereference_sched(*per_cpu_ptr(&cpufreq_update_util_data, + cpu_of(rq))); if (data) data->func(data, rq_clock(rq), flags); }