Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5606625ybh; Wed, 7 Aug 2019 08:35:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqydIo6oq+uNBZd3rsEVjm8r4UDpO4vJWeiElDaLECnKT4b+DuBOcJ1eyvR7ZgmWlRDs+12E X-Received: by 2002:a63:b10f:: with SMTP id r15mr8123336pgf.230.1565192138542; Wed, 07 Aug 2019 08:35:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565192138; cv=none; d=google.com; s=arc-20160816; b=V72vIGTbWfita7k3e3VTmRBO1/NBsFzIWz/OtV2a0k/leJkjeWf2GYV4aBC5gFfliV 6cEird4O+NGSVPTLgNw4wDsLzes1gQ9ci6dz6u0seNTn4FNbqdFQQS3JYNVb3O4RPEbE FgE/An+U79w+M7ks8qVD6RnRYin8h6CTL2nwltry/VrzAUhKCZg1BGL8IJw44Y4AEtVi i2bqmD8MkX2OJy9r9Wk5/iKYKK5rMF2tiGoY3Co3Snj+P+RIQGSm1UWbsW/tRjxBVR8n rEaqRLKjJYQT7QRzfE1qsnGSI6tMYek1vyvNzRIG/G3K9PvHeZSTlymHxs4hFQaXupVz FETw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=QN7I1t+nVuMcIZgTAg/JHW63qa2qi5Xt+fmYo85M0rE=; b=fyhadJGC3iH7sy7976HVJxpUe1g0uVRgHdgtEaWPRHFCMq9FVbW/9EnEVnXsrY0ZVX jvAGCp5TsfLzsZhH2HRTm3twg6U6Ly7bDjC7p2Vz7yHEl+o9v2qHigQPbaL9zGu09pGV ie3zqRW3QPNRX5dN6LWe6lXq+aGzA3veS/J43Ce2A7ayaYLV52kaDFLQi+azvnEC20jx /O4Utv9ZcAnKqGGDGARmzqBozejbdtjDE26gU+B/uUr3YCamhnJ85q5JGSxUWNVGC+b7 45yJQwiV3uGEjll7pGU1G5h2qje+5E8Rrq6dmPAHIEtto7r8GFDQxvJLIcgOR3lcrQyO Au/g== 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 br18si159844pjb.52.2019.08.07.08.35.21; Wed, 07 Aug 2019 08:35:38 -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 S2388657AbfHGPeF (ORCPT + 99 others); Wed, 7 Aug 2019 11:34:05 -0400 Received: from foss.arm.com ([217.140.110.172]:50374 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387543AbfHGPeE (ORCPT ); Wed, 7 Aug 2019 11:34:04 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3E333344; Wed, 7 Aug 2019 08:34:04 -0700 (PDT) Received: from e107049-lin.arm.com (e107049-lin.cambridge.arm.com [10.1.195.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 56C783F706; Wed, 7 Aug 2019 08:34:03 -0700 (PDT) From: Douglas RAILLARD To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: rjw@rjwysocki.net, viresh.kumar@linaro.org, mingo@redhat.com, peterz@infradead.org Subject: [PATCH] sched/cpufreq: Align trace event behavior of fast switching Date: Wed, 7 Aug 2019 16:33:40 +0100 Message-Id: <20190807153340.11516-1-douglas.raillard@arm.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fast switching path only emits an event for the CPU of interest, whereas the regular path emits an event for all the CPUs that had their frequency changed, i.e. all the CPUs sharing the same policy. With the current behavior, looking at cpu_frequency event for a given CPU that is using the fast switching path will not give the correct frequency signal. Signed-off-by: Douglas RAILLARD --- kernel/sched/cpufreq_schedutil.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 1f82ab108bab..975ccc3de807 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -153,6 +153,7 @@ static void sugov_fast_switch(struct sugov_policy *sg_policy, u64 time, unsigned int next_freq) { struct cpufreq_policy *policy = sg_policy->policy; + int cpu; if (!sugov_update_next_freq(sg_policy, time, next_freq)) return; @@ -162,7 +163,11 @@ static void sugov_fast_switch(struct sugov_policy *sg_policy, u64 time, return; policy->cur = next_freq; - trace_cpu_frequency(next_freq, smp_processor_id()); + + if (trace_cpu_frequency_enabled()) { + for_each_cpu(cpu, policy->cpus) + trace_cpu_frequency(next_freq, cpu); + } } static void sugov_deferred_update(struct sugov_policy *sg_policy, u64 time, -- 2.22.0