linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: Qais Yousef <qyousef@layalina.io>
Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	rafael@kernel.org, linux-pm@vger.kernel.org, rostedt@goodmis.org,
	mhiramat@kernel.org, mingo@redhat.com, peterz@infradead.org,
	juri.lelli@redhat.com, vincent.guittot@linaro.org,
	dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de,
	bristot@redhat.com, vschneid@redhat.com, delyank@fb.com,
	qyousef@google.com, kernel test robot <lkp@intel.com>
Subject: Re: [RESEND][PATCH v2 3/3] schedutil: trace: Add tracing to capture filter out requests
Date: Tue, 20 Jun 2023 18:52:59 +0100	[thread overview]
Message-ID: <a0101269-1d8b-d4e1-52b4-250a99b395fa@arm.com> (raw)
In-Reply-To: <20230531183105.r5tqpdx5axoogkzp@airbuntu>

Hi Qais,

I have somehow missed your feedback on this series.

On 5/31/23 19:31, Qais Yousef wrote:
> On 05/22/23 15:57, Lukasz Luba wrote:
>> Some of the frequency update requests coming form the task scheduler
>> might be filter out. It can happen when the previous request was served
>> not that long ago (in a period smaller than provided by the cpufreq driver
>> as minimum for frequency update). In such case, we want to know if some of
>> the frequency updates cannot make through.
>> Export the new tracepoint as well. That would allow to handle it by a
>> toolkit for trace analyzes.
>>
>> Reported-by: kernel test robot <lkp@intel.com> # solved tricky build
>> Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
>> ---
>>   include/trace/events/sched.h     |  4 ++++
>>   kernel/sched/cpufreq_schedutil.c | 10 ++++++++--
>>   2 files changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
>> index dbfb30809f15..e34b7cd5de73 100644
>> --- a/include/trace/events/sched.h
>> +++ b/include/trace/events/sched.h
>> @@ -739,6 +739,10 @@ DECLARE_TRACE(uclamp_update_tsk_tp,
>>   	TP_PROTO(struct task_struct *tsk, int uclamp_id,  unsigned int value),
>>   	TP_ARGS(tsk, uclamp_id, value));
>>   
>> +DECLARE_TRACE(schedutil_update_filtered_tp,
>> +	TP_PROTO(int cpu),
>> +	TP_ARGS(cpu));
>> +
>>   #endif /* _TRACE_SCHED_H */
>>   
>>   /* This part must be outside protection */
>> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
>> index f462496e5c07..4f9daf258a65 100644
>> --- a/kernel/sched/cpufreq_schedutil.c
>> +++ b/kernel/sched/cpufreq_schedutil.c
>> @@ -6,6 +6,8 @@
>>    * Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>>    */
>>   
>> +EXPORT_TRACEPOINT_SYMBOL_GPL(schedutil_update_filtered_tp);
>> +
>>   #define IOWAIT_BOOST_MIN	(SCHED_CAPACITY_SCALE / 8)
>>   
>>   struct sugov_tunables {
>> @@ -318,8 +320,10 @@ static inline bool sugov_update_single_common(struct sugov_cpu *sg_cpu,
>>   
>>   	ignore_dl_rate_limit(sg_cpu);
>>   
>> -	if (!sugov_should_update_freq(sg_cpu->sg_policy, time))
>> +	if (!sugov_should_update_freq(sg_cpu->sg_policy, time)) {
>> +		trace_schedutil_update_filtered_tp(sg_cpu->cpu);
>>   		return false;
>> +	}
> 
> Can't we have something more generic here too? Are you interested to count
> these events? How do you plan to use it?

The plan is to record those events, count them and maybe adjust the FW
if the frequency switching capabilities are too low, e.g. 4ms...

We need those numbers to point out that there is a need for faster
FW micro-controller to serve those incoming requests.

> 
> I think this will be a very noisy event by the way.

Could be, but on the other hand for those statistical analysis
'the more the better'. It will also depend on number of
CPUs in the cluster, e.g. 4 CPUs vs 1 CPU.

I don't know when we will switch to this per-cpu cpufreq mode
when all CPUs behave like independent DVFS. Juno mainline kernel and FW
supports that mode. We would have to compare those two modes and
measure how much we gain/loose when using one and not the other.

Furthermore, we already suspect some of our integration testing for
EAS-mainline (on Juno) failing due to filtered out requests. How much
that would impact other boards - it would be nice to see in traces.

Thanks for your feedback!
Lukasz

  parent reply	other threads:[~2023-06-20 17:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-22 14:56 [RESEND][PATCH v2 0/3] Add basic tracing for uclamp and schedutil Lukasz Luba
2023-05-22 14:57 ` [RESEND][PATCH v2 1/3] sched/tp: Add new tracepoint to track uclamp set from user-space Lukasz Luba
     [not found]   ` <20230531182629.nztie5rwhjl53v3d@airbuntu>
2023-06-21  3:25     ` Masami Hiramatsu
2023-06-30 11:49       ` Qais Yousef
2023-07-04  7:49         ` Lukasz Luba
2023-07-04 14:02           ` Qais Yousef
2023-07-06 11:14     ` Peter Zijlstra
2023-07-19 13:18       ` Lukasz Luba
2023-05-22 14:57 ` [RESEND][PATCH v2 2/3] cpufreq: schedutil: Refactor sugov_update_shared() internals Lukasz Luba
2023-06-20 17:36   ` Rafael J. Wysocki
2023-05-22 14:57 ` [RESEND][PATCH v2 3/3] schedutil: trace: Add tracing to capture filter out requests Lukasz Luba
2023-06-20 17:40   ` Rafael J. Wysocki
2023-06-20 18:08     ` Lukasz Luba
     [not found]   ` <20230531183105.r5tqpdx5axoogkzp@airbuntu>
2023-06-20 17:52     ` Lukasz Luba [this message]
2023-06-30 12:01       ` Qais Yousef
2023-06-30 13:25         ` Qais Yousef
2023-07-04  8:23           ` Lukasz Luba
2023-07-04 13:58             ` Qais Yousef

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a0101269-1d8b-d4e1-52b4-250a99b395fa@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=delyank@fb.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mgorman@suse.de \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=qyousef@google.com \
    --cc=qyousef@layalina.io \
    --cc=rafael@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).