Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6283888rwl; Wed, 22 Mar 2023 08:40:21 -0700 (PDT) X-Google-Smtp-Source: AK7set9rUmmCElNtVyrU8blxsrdJcOrBTj1YH/q+ueLNI/pdH1yry40gQxOYj3T4y94K9pT4E+Cv X-Received: by 2002:aa7:d1d5:0:b0:4bd:8714:cc54 with SMTP id g21-20020aa7d1d5000000b004bd8714cc54mr7272409edp.36.1679499621169; Wed, 22 Mar 2023 08:40:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679499621; cv=none; d=google.com; s=arc-20160816; b=Ao3Kw83lsSC1IG6S7DqpmxA9Mnr9Gim7YnKhoEHSKYgmEXQTNtOYMRRfF6fJDf/Mm5 awMAmJdccM/u5xgI+pTzioJkwW84hYANUivpYuB1mMzBmGUsqMInC3R9CKIc3YRcdga7 3i30FzygocN1C/K4PIw+fOla9Vsw5FegjCgz4uGiJxlzM+EqE97wWyBLCZOcKWVHSlFR s2oD8W2qq/NUWiqwYG9ECnPp/Q8BjbcE43q9YuvQTZ6A0Jqd7eW0aQrGEzGDh+sOYR/f kahNj0Jd99hJSEZ9mNGpFRFysACUDLNKILJGrjN8DFR6LTqIKOFIumImkO0WYS5nMxBz iCZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=gMa4KlEe8j/layTGD33sQhZ0VWZdr2+d0Oc9jRwTu7k=; b=lw8gdnok5O3aF5mVtkzYpNHrXrMxKQa0Ij0tCZIjspAzt/D6dXYn45BA6k8jGSmSlU FzJ29jNrYpdRupXKYLAdmU6XZP59pt6yj2Baf2/YnBprv2y+FUK20LK6f1hcLiTzCWB2 /sXz0nDQMUHyHZidebYXSXXglxQzobhZROhZ/bsf2B1MUU+oXsrXQFci0THiT0DnbH8v ow0+6VcXWyk5qr8xEzQsNTwrc1VY3lRZ4IHG3ahb+m+rpeZCuY6YO7VksJB19HB5/lG8 AJCiOB1S4QO1iAG92BUNpLLYohCPfo9CsD3fwKi3prgG7LcRe/9aXlYWOaaFE8qrsXis ZlAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r21-20020aa7d595000000b004fd1f069ba6si8759147edq.560.2023.03.22.08.39.57; Wed, 22 Mar 2023 08:40:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231719AbjCVPU3 (ORCPT + 99 others); Wed, 22 Mar 2023 11:20:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231601AbjCVPU1 (ORCPT ); Wed, 22 Mar 2023 11:20:27 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9743B5BDBC; Wed, 22 Mar 2023 08:20:20 -0700 (PDT) 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 5F1FD1650; Wed, 22 Mar 2023 08:21:04 -0700 (PDT) Received: from e123648.arm.com (unknown [10.57.18.173]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B2F0A3F71E; Wed, 22 Mar 2023 08:20:17 -0700 (PDT) From: Lukasz Luba To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: 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, lukasz.luba@arm.com, qyousef@google.com Subject: [PATCH 3/3] schedutil: trace: Add tracing to capture filter out requests Date: Wed, 22 Mar 2023 15:18:43 +0000 Message-Id: <20230322151843.14390-4-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230322151843.14390-1-lukasz.luba@arm.com> References: <20230322151843.14390-1-lukasz.luba@arm.com> X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Lukasz Luba --- include/trace/events/schedutil.h | 17 +++++++++++++++++ kernel/sched/cpufreq_schedutil.c | 14 ++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 include/trace/events/schedutil.h diff --git a/include/trace/events/schedutil.h b/include/trace/events/schedutil.h new file mode 100644 index 000000000000..7f25122f7257 --- /dev/null +++ b/include/trace/events/schedutil.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM schedutil + +#if !defined(_TRACE_SCHEDUTIL_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_SCHEDUTIL_H + +#include + +DECLARE_TRACE(schedutil_update_filtered_tp, + TP_PROTO(int cpu), + TP_ARGS(cpu)); + +#endif /* _TRACE_SCHEDUTIL_H */ + +/* This part must be outside protection */ +#include diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index f462496e5c07..45c18559f3a8 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -6,6 +6,12 @@ * Author: Rafael J. Wysocki */ +#define CREATE_TRACE_POINTS +#include +#undef CREATE_TRACE_POINTS + +EXPORT_TRACEPOINT_SYMBOL_GPL(schedutil_update_filtered_tp); + #define IOWAIT_BOOST_MIN (SCHED_CAPACITY_SCALE / 8) struct sugov_tunables { @@ -318,8 +324,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; + } sugov_get_util(sg_cpu); sugov_iowait_apply(sg_cpu, time, max_cap); @@ -446,8 +454,10 @@ sugov_update_shared(struct update_util_data *hook, u64 time, unsigned int flags) ignore_dl_rate_limit(sg_cpu); - if (!sugov_should_update_freq(sg_policy, time)) + if (!sugov_should_update_freq(sg_policy, time)) { + trace_schedutil_update_filtered_tp(sg_cpu->cpu); goto unlock; + } next_f = sugov_next_freq_shared(sg_cpu, time); -- 2.17.1