From patchwork Tue Mar 28 08:34:46 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: 75898 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2059370vqo; Tue, 28 Mar 2023 01:37:07 -0700 (PDT) X-Google-Smtp-Source: AKy350aD+cFJXdvsdxGSKkIW9fUfxZXXLFqIhQah4Jo7oHGLsZy7Q5aRy6dHsn1vUfKVr//Vr/+L X-Received: by 2002:a17:90b:3e81:b0:23a:ad68:25a7 with SMTP id rj1-20020a17090b3e8100b0023aad6825a7mr16776462pjb.2.1679992627046; Tue, 28 Mar 2023 01:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679992627; cv=none; d=google.com; s=arc-20160816; b=U6KsxlDiLXfufUx505bjWv6UQusvKfwPpC6Oe3q7s+XrMiJPOYoh2a0t0sayVl/KvI CvA36gKYw6cKC8My2h1XXn7fbVVCsp9igUeGtVJAFKMYmeZY7gxhHI7u7YVqqY19Ege+ tcSn60S2695EBI1K1oaHRObMP5D/ltFuT77uWSzRLYkqSQ3HbhlyTcNaGYsselkUCFOi 84+/K9gqgQ8zV5hoNTdXmEVF5sS+PvwoGJOolViD63FFGi+TV2Zzrc3+oMA8wopuM6En RbeUIQR/IEOjpUIrOh7KyR9jgZiyb6L3Nv5C8Uj3lfndfL0t88UaC6ORzE6H8Kh0P6/z 07vg== 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:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=XO6hDe3Y+PUd7kKgZVf+zuUdDB4Cc0B8dXgM5NXPIE8=; b=oF+1Wls+LJ4iRDl9Pbe3xrC6E0R7IgB+fu4NZ15gz1UZZgTwSuue5YhIdtDYfSXr2b VrANYlAuLqZITOr6KQ7LNZHae91WkqPcEz6hPZu7b3p9pNbn3WmMTHEoFKKt7XT7nJh0 XphZUgdnP79hhg3BQoxpKMczdgr4s9wb2yMqPTJ8GqehXjrcBpQhvUs34aInQLT9HFoh Euz8am7+GOqQ+TdB+o5Cs1f5XNNWLnDMhgojBaKsGqzudnAtXGZewhxJvserRrZWO0fB +6lDLYWkTlWwABUf7zqFkuTBI5iZ4hluKoHocA8V84M/KVDnHScrMNhtO7CN4V7JmJon T7UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=q2YLWKQ4; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv12-20020a17090af18c00b0023f6805f20asi12326928pjb.79.2023.03.28.01.36.55; Tue, 28 Mar 2023 01:37:07 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=q2YLWKQ4; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232572AbjC1IfL (ORCPT + 99 others); Tue, 28 Mar 2023 04:35:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232324AbjC1Iev (ORCPT ); Tue, 28 Mar 2023 04:34:51 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A061335A1; Tue, 28 Mar 2023 01:34:50 -0700 (PDT) Date: Tue, 28 Mar 2023 08:34:46 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1679992486; 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: in-reply-to:in-reply-to:references:references; bh=XO6hDe3Y+PUd7kKgZVf+zuUdDB4Cc0B8dXgM5NXPIE8=; b=q2YLWKQ46VYo26Ssu8LHoYac0li5Rdoiea3SNVfqg87HYZ8dHzrNszv6jTddEiGVYshkyT KZa91cRPSFoYCsUUPKImShjgkiyfHDnev0lrwMy7QyMZJU+HVFrgw+lYR+tlssf+P/mrbm no7SI7eWOM2FmXUF4nBWSgozQ1zO/z60F01vaeOdEKjwxD1AZpM4QfGD3V3UQAHY0YTNr8 93MOaYtoB1/bjQPbE+HlclKy6IqF57SG2SPwgOIX1mMUqKXfzVo0gvPQUz7xK2iGaT6yus 1ltF2vmCBZC9uLezmVbOCzsERB4gP4ktlFdeWFpr2Uzaf0bvVNryg0MTuGf4nw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1679992486; 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: in-reply-to:in-reply-to:references:references; bh=XO6hDe3Y+PUd7kKgZVf+zuUdDB4Cc0B8dXgM5NXPIE8=; b=g86gzRx3SGHd5mRdGuuMA7sa3P6INk8YJraspl7eCxcYWzNNTAxXvoVh1XTJJo7r124EuN KQYtSvligSxkVbCg== From: "tip-bot2 for Valentin Schneider" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: smp/core] sched, smp: Trace IPIs sent via send_call_function_single_ipi() Cc: Valentin Schneider , "Peter Zijlstra (Intel)" , "Steven Rostedt (Google)" , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230307143558.294354-3-vschneid@redhat.com> References: <20230307143558.294354-3-vschneid@redhat.com> MIME-Version: 1.0 Message-ID: <167999248631.5837.6674946507911418669.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759722720604773112?= X-GMAIL-MSGID: =?utf-8?q?1761599948663279264?= The following commit has been merged into the smp/core branch of tip: Commit-ID: cc9cb0a71725aa8dd8d8f534a9b562bbf7981f75 Gitweb: https://git.kernel.org/tip/cc9cb0a71725aa8dd8d8f534a9b562bbf7981f75 Author: Valentin Schneider AuthorDate: Tue, 07 Mar 2023 14:35:53 Committer: Peter Zijlstra CommitterDate: Fri, 24 Mar 2023 11:01:27 +01:00 sched, smp: Trace IPIs sent via send_call_function_single_ipi() send_call_function_single_ipi() is the thing that sends IPIs at the bottom of smp_call_function*() via either generic_exec_single() or smp_call_function_many_cond(). Give it an IPI-related tracepoint. Note that this ends up tracing any IPI sent via __smp_call_single_queue(), which covers __ttwu_queue_wakelist() and irq_work_queue_on() "for free". Signed-off-by: Valentin Schneider Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Steven Rostedt (Google) Acked-by: Ingo Molnar Link: https://lore.kernel.org/r/20230307143558.294354-3-vschneid@redhat.com --- arch/arm/kernel/smp.c | 1 - arch/arm64/kernel/smp.c | 1 - kernel/sched/core.c | 9 +++++++-- kernel/smp.c | 2 ++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 0b8c257..5edf092 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -48,7 +48,6 @@ #include #include -#define CREATE_TRACE_POINTS #include /* diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 4e83272..438c16f 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -51,7 +51,6 @@ #include #include -#define CREATE_TRACE_POINTS #include DEFINE_PER_CPU_READ_MOSTLY(int, cpu_number); diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 488655f..c26a2cd 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -80,6 +80,7 @@ #define CREATE_TRACE_POINTS #include #include +#include #undef CREATE_TRACE_POINTS #include "sched.h" @@ -95,6 +96,8 @@ #include "../../io_uring/io-wq.h" #include "../smpboot.h" +EXPORT_TRACEPOINT_SYMBOL_GPL(ipi_send_cpumask); + /* * Export tracepoints that act as a bare tracehook (ie: have no trace event * associated with them) to allow external modules to probe them. @@ -3830,10 +3833,12 @@ void send_call_function_single_ipi(int cpu) { struct rq *rq = cpu_rq(cpu); - if (!set_nr_if_polling(rq->idle)) + if (!set_nr_if_polling(rq->idle)) { + trace_ipi_send_cpumask(cpumask_of(cpu), _RET_IP_, NULL); arch_send_call_function_single_ipi(cpu); - else + } else { trace_sched_wake_idle_without_ipi(cpu); + } } /* diff --git a/kernel/smp.c b/kernel/smp.c index 298ba75..770e879 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -26,6 +26,8 @@ #include #include +#include + #include "smpboot.h" #include "sched/smp.h"