From patchwork Wed Nov 15 09:04:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 165206 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2412063vqg; Wed, 15 Nov 2023 01:05:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGHkLdtKjvZH1eeF0Un8QeN4P5NKch9egJEM/XYPRzv0qkPu3NJNJUenToKCVT9bWuOL71o X-Received: by 2002:a05:6a00:6c89:b0:6c3:38f5:99d2 with SMTP id jc9-20020a056a006c8900b006c338f599d2mr11893029pfb.11.1700039113498; Wed, 15 Nov 2023 01:05:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700039113; cv=none; d=google.com; s=arc-20160816; b=EAl6VlX0dEbZLrDhmF6ZiySSqUZzJao2MSkso0E+kD/6MmqL3sXMO8G/hkP0JQgp7c /JIPm/mjUa9iMaQM6Bmjy03czqHEdKZik1z65R2CVLDUOpiwkErwS8hZcFKyIufElaPq NOnBG6ClhGS2WD5CbdmpTj07I96Y4lE7eEZa+dJhtzVn03Fs2qYFrmY36RRGBsX32CoO hdWiP066xffn/pX+0gcDupM3qr0/z+TB+VPQBshOkTm28SjjldLqPXo59CWHNiJcF6qS ZdDC023CDqD37R2Zo8AIaklECddEEntraNIRKmMiPF3a1Ry8CYLQots+61EFYM8TD2i2 FCGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=1oYoR9HMpWTrMNNt5tJiIV35XwNwJfCVnIk+94z5U78=; fh=H2MkSknZKy/XcUE0SNWlqZifRHvGVZQUr5cmv0Cbtz8=; b=GXj2eLmGq81MYOEXkwpJXqFPVKhMEfYJzMvEQOSfwHtkIV027049CJhbCMRLj2lvgA Pkewj7slXs4AE4STQUZEfuJLnHHZrj3Ogef4pBZhz23gj2GIvujRghr85LsWZJk30Jug VzqS6fcDP9s6Y+AsBRAM94ljr9G08v4bgyaeCI2aR3GzAvzMNwcwMtIdtzoxjCamr4BA xeIKgk7rtRYedfLY2VVEbUza933EDzty9Ley2Pkq4SZ5pw5ZaK7JX/2p6zSrgka3FX0/ 3+avHa5hri/6tnX9xK3PKHPYJLOpMsyoi+tkoM6r3SGd4bfodP2cB9qesctdRoDux5Nd lMiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=L1vp1u3C; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id y66-20020a636445000000b00578b63123desi9837650pgb.789.2023.11.15.01.05.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 01:05:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=L1vp1u3C; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 83166813388E; Wed, 15 Nov 2023 01:05:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234722AbjKOJFC (ORCPT + 28 others); Wed, 15 Nov 2023 04:05:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234675AbjKOJE5 (ORCPT ); Wed, 15 Nov 2023 04:04:57 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8172B11C; Wed, 15 Nov 2023 01:04:54 -0800 (PST) Date: Wed, 15 Nov 2023 09:04:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1700039093; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1oYoR9HMpWTrMNNt5tJiIV35XwNwJfCVnIk+94z5U78=; b=L1vp1u3CGnHtFHevFkVvRzfzXWwyzS5b+RRHRiojmYMWnU/j+oZpOufiyvk/4Wz4IQxurX rOShvr+V2+OLvDhXrChmf8+W2gpwZXIwpgr/ZvDP6VQiwlbPbu+5ONqoxnIHPciCt/0z6c wotNHxYMXmtbWjJ43uHwAl4RpfH9YWjTk/7jnmOBHqOfJO5F6yzY+WN/z2JUsF1kXkTWk+ 5zCO8OhnFMyvozDj7gvXgW5BPHTHJ+5VjiN5rLHR3H7S8atyxGiRod2nGn3OTnhraIZTRA Y4BawcnG7fiPdUm0RXEMdds7JULOa7YPQmro91aY0StMwrWZ05DkCgFP4ajMrA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1700039093; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1oYoR9HMpWTrMNNt5tJiIV35XwNwJfCVnIk+94z5U78=; b=gMSXULWbWGqfN+qfypIUK6gxfg1GPJEUNsVtQxGmxzIKEHiQv1xMmUmvgsGWVSvoWG2Fnc M10OCtYeSqhdtdAg== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched: Remove vruntime from trace_sched_stat_runtime() Cc: "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <170003909260.391.5473779409458503289.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 01:05:11 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782620213297494678 X-GMAIL-MSGID: 1782620213297494678 The following commit has been merged into the sched/core branch of tip: Commit-ID: 5fe6ec8f6ab549b6422e41551abb51802bd48bc7 Gitweb: https://git.kernel.org/tip/5fe6ec8f6ab549b6422e41551abb51802bd48bc7 Author: Peter Zijlstra AuthorDate: Mon, 06 Nov 2023 13:41:43 +01:00 Committer: Peter Zijlstra CommitterDate: Wed, 15 Nov 2023 09:57:49 +01:00 sched: Remove vruntime from trace_sched_stat_runtime() Tracing the runtime delta makes sense, observer can sum over time. Tracing the absolute vruntime makes less sense, inconsistent: absolute-vs-delta, but also vruntime delta can be computed from runtime delta. Removing the vruntime thing also makes the two tracepoint sites identical, allowing to unify the code in a later patch. Signed-off-by: Peter Zijlstra (Intel) --- include/trace/events/sched.h | 15 ++++++--------- kernel/sched/fair.c | 5 ++--- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 6188ad0..dbb01b4 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -493,33 +493,30 @@ DEFINE_EVENT_SCHEDSTAT(sched_stat_template, sched_stat_blocked, */ DECLARE_EVENT_CLASS(sched_stat_runtime, - TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime), + TP_PROTO(struct task_struct *tsk, u64 runtime), - TP_ARGS(tsk, __perf_count(runtime), vruntime), + TP_ARGS(tsk, __perf_count(runtime)), TP_STRUCT__entry( __array( char, comm, TASK_COMM_LEN ) __field( pid_t, pid ) __field( u64, runtime ) - __field( u64, vruntime ) ), TP_fast_assign( memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); __entry->pid = tsk->pid; __entry->runtime = runtime; - __entry->vruntime = vruntime; ), - TP_printk("comm=%s pid=%d runtime=%Lu [ns] vruntime=%Lu [ns]", + TP_printk("comm=%s pid=%d runtime=%Lu [ns]", __entry->comm, __entry->pid, - (unsigned long long)__entry->runtime, - (unsigned long long)__entry->vruntime) + (unsigned long long)__entry->runtime) ); DEFINE_EVENT(sched_stat_runtime, sched_stat_runtime, - TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime), - TP_ARGS(tsk, runtime, vruntime)); + TP_PROTO(struct task_struct *tsk, u64 runtime), + TP_ARGS(tsk, runtime)); /* * Tracepoint for showing priority inheritance modifying a tasks diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 11073cf..33db70c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1138,8 +1138,7 @@ s64 update_curr_common(struct rq *rq) if (unlikely(delta_exec <= 0)) return delta_exec; - trace_sched_stat_runtime(curr, delta_exec, 0); - + trace_sched_stat_runtime(curr, delta_exec); account_group_exec_runtime(curr, delta_exec); cgroup_account_cputime(curr, delta_exec); @@ -1168,7 +1167,7 @@ static void update_curr(struct cfs_rq *cfs_rq) if (entity_is_task(curr)) { struct task_struct *curtask = task_of(curr); - trace_sched_stat_runtime(curtask, delta_exec, curr->vruntime); + trace_sched_stat_runtime(curtask, delta_exec); cgroup_account_cputime(curtask, delta_exec); account_group_exec_runtime(curtask, delta_exec); }