From patchwork Fri Dec 2 15:58:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 28952 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp937936wrr; Fri, 2 Dec 2022 08:01:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Pe9n9LlHppS+Oyg2crW7t+HDSjJR5eOPpz+Au2RqvynCf5ax6lznn/6aFvmJdinC/QQUW X-Received: by 2002:a17:902:ced1:b0:179:ee31:1527 with SMTP id d17-20020a170902ced100b00179ee311527mr22002260plg.138.1669996908980; Fri, 02 Dec 2022 08:01:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669996908; cv=none; d=google.com; s=arc-20160816; b=EjX/yBkFrBr8wh6G57JALia/gHi61ZC3CfLSoNV44ofiUt/qDjKsec8pn9qCzZxMJU wMT0rvCgxrfr9A/o7JEovdtX0tyfUWXWTzTZL8MZeJoBADY6OuK9H8Yj0fVhKGTPkBeQ DnTh/+R8clde+dOvhs8Mv9qDlJAOL3jPioir0AqxEQ5iLM4m/PEL0q8BRMpMgJ5C1ASk 51CQGnRfChjuRsf7INOhmisnD3zzwO6M6xKhV593kKfQGfAtmKiMsHPBB4IvsDptUj/E 9CIo9VjZtTinzmh/cK6NfDIV9UMK7rM68GcP+vYG+xIEBXwibMUg+dD74vnHDTMrhM97 KHjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uzgc0mUISh4RQwmAXJRmvlcbcfqhtS4nRVialK+bVYE=; b=qxhVcxP97Z64vykbP1jszGPIz1EQ/Ve9H4HhaOgV99KQj2FmqZKYH2OAHWjq+fsvqb EZTX/wX9Q10dvZIvMU0PFCqKJqkP4nPOOuIV6zIQmyl7P9nb6LiXmEyJt8/UUbAOKyhR woK38w9rPHXkQW+F6+qnTI9RFzaRGEvs/BLeSK4ey0mnAUqa1F/BxQMWMb05H6/qWwju +M8jeqsTQSTcjLdyhFJST/YThW2KxTtkiiuvdnIDGQ9AAemNEywTZonmfMZNyXklP97s VkFuie1dBEwTH5uy5jC+8dnCsJXG2igaHJ95GZpoi8M29ZoeC4++lUnSFtzbPdhA48sc wxLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=igZd6YV1; 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=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a635408000000b00476a08c5d87si7187564pgb.713.2022.12.02.08.01.33; Fri, 02 Dec 2022 08:01:48 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=igZd6YV1; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233873AbiLBQBH (ORCPT + 99 others); Fri, 2 Dec 2022 11:01:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233871AbiLBQAZ (ORCPT ); Fri, 2 Dec 2022 11:00:25 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06ED5A9590 for ; Fri, 2 Dec 2022 07:59:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669996760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uzgc0mUISh4RQwmAXJRmvlcbcfqhtS4nRVialK+bVYE=; b=igZd6YV18H1Ry7aBCi1UP9SGrpFFRLa55sEpT8Yjbe1OKZFk0hP4Rd2PMeNLfDWTHUSsl4 0A/X92DqIqeoFm0Qh8dNz4aNWvf4IwhA/4/3a/FuQ4yxOp4Bna41k6pkLY/E3iX4waiWzj foehYRj7AZ5wrkmTQMFF6ob1ApHevVs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-207-bTpaOTExOIuFIHa5yC3C0A-1; Fri, 02 Dec 2022 10:59:10 -0500 X-MC-Unique: bTpaOTExOIuFIHa5yC3C0A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 708C0833A0F; Fri, 2 Dec 2022 15:59:07 +0000 (UTC) Received: from vschneid.remote.csb (unknown [10.33.36.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 255752028E96; Fri, 2 Dec 2022 15:59:03 +0000 (UTC) From: Valentin Schneider To: linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, openrisc@lists.librecores.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org, x86@kernel.org Cc: Steven Rostedt , "Paul E. McKenney" , Peter Zijlstra , Thomas Gleixner , Sebastian Andrzej Siewior , Juri Lelli , Daniel Bristot de Oliveira , Marcelo Tosatti , Frederic Weisbecker , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Marc Zyngier , Mark Rutland , Russell King , Nicholas Piggin , Guo Ren , "David S. Miller" Subject: [PATCH v3 3/8] sched, smp: Trace IPIs sent via send_call_function_single_ipi() Date: Fri, 2 Dec 2022 15:58:12 +0000 Message-Id: <20221202155817.2102944-4-vschneid@redhat.com> In-Reply-To: <20221202155817.2102944-1-vschneid@redhat.com> References: <20221202155817.2102944-1-vschneid@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751118678706670891?= X-GMAIL-MSGID: =?utf-8?q?1751118678706670891?= 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 Reviewed-by: Steven Rostedt (Google) Acked-by: Ingo Molnar --- arch/arm/kernel/smp.c | 3 --- arch/arm64/kernel/smp.c | 1 - kernel/sched/core.c | 7 +++++-- kernel/smp.c | 4 ++++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 978db2d96b446..3b280d55c1c40 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -48,9 +48,6 @@ #include #include -#define CREATE_TRACE_POINTS -#include - /* * as from 2.5, kernels no longer have an init_tasks structure * so we need some other way of telling a new secondary core diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index ffc5d76cf6955..937d2623e06ba 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 daff72f003858..40587b0d99329 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -81,6 +81,7 @@ #include #include #undef CREATE_TRACE_POINTS +#include #include "sched.h" #include "stats.h" @@ -3746,10 +3747,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 06a413987a14a..e2ca1e2f31274 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -26,6 +26,10 @@ #include #include +#define CREATE_TRACE_POINTS +#include +#undef CREATE_TRACE_POINTS + #include "smpboot.h" #include "sched/smp.h"