From patchwork Tue Mar 7 14:35:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 65613 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2473147wrd; Tue, 7 Mar 2023 06:53:18 -0800 (PST) X-Google-Smtp-Source: AK7set9udePCDOKajeuqN3B1LqrKSrlSmnL7T57TRVRy0QIWa+PtgDaDNORKeRUdYaIkPNnSlEBc X-Received: by 2002:a05:6a20:7883:b0:cc:8a62:d0da with SMTP id d3-20020a056a20788300b000cc8a62d0damr12131986pzg.12.1678200797786; Tue, 07 Mar 2023 06:53:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678200797; cv=none; d=google.com; s=arc-20160816; b=RezrivJwAmHCzqLFyCt1zcUP9CEaVagIRP7nUzUM65UDJvBArv0qIJ1jodxxfwMomF onpX3Vtaatq7j4JTiji8OzCunpVc/RYawUiqoazdPlZ5kvbLLS0EtEQFxXRpfMXZCZvG MV7m4HXmhS38cWG9JO8N0MVx4XFhOOqSUTKqm101CNsrUhYMC2kUPXqYcPlZD46B5gq7 /swN1C2otdvNVqmLRWxpTjnlUJQdC8UPDHSdxgB8ryu6lRiAJu0ZNtHdjzj/m3NscmWL ZHT6o+ENyw8nBZDdbKR5Z3kx1uoEUMUoYD4vJepO1OyV+fO1JlOlxRUguzYkRNxhD7L2 p69Q== 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=6o4aDoMnOyw6oIKqxXD/63VXzreRgu7lohjEhFx0NNg=; b=D3mbOm+HFbJDWXBFkAUzzIJ3qbq1oQRueWzBNi1GbKsjJU5vGpvWTtaZ1o7VW/eFcG iE7EIz+3PZWxV2iqqCIm2LPWnsMNApVaEZZPMU+4Wc3PODlKm7Ta9BW/Ux38yv6qRbc+ /gk8zRQRUKLyfZoSk7F7ZMXssT7XLNi6dLeHhyizQh8SzcmnxkLF75se9rVKWthnxDRn t8WXbFnnV8JvVbMLjsciwjMRuS78dpQeauQXcOp20kH3/XrqMG/UK4YrREfcl7Oh+EJW J9WR2jJiHEuxM3Ci6Sp63Epo/x7eiLzbkXsrdFLbW92RNsWPlVwcQNCRczb8kcTnQsws zX6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VDcD6C0r; 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 m3-20020a632603000000b00502f0ccbcc0si12448835pgm.233.2023.03.07.06.53.04; Tue, 07 Mar 2023 06:53:17 -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=VDcD6C0r; 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 S230061AbjCGOuI (ORCPT + 99 others); Tue, 7 Mar 2023 09:50:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231344AbjCGOsw (ORCPT ); Tue, 7 Mar 2023 09:48:52 -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 48D153B86D for ; Tue, 7 Mar 2023 06:38:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678199817; 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=6o4aDoMnOyw6oIKqxXD/63VXzreRgu7lohjEhFx0NNg=; b=VDcD6C0rJ3PES8VfhbrDXs9MUBeBiqFIodAHM06NjaIgsxqO3FD0va8Bk/ZeK8mzh0yTvg hRrlybehkbGmaSHJn58YsDO1othQbWxspYyiusQCB0avFrLBd9ATb7ULTiGATv8Q/Wkgka ANivJXk4fgwTLND03GSzMUBVM9Y6DEA= 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-649-XW0v8MhWNSK-ZY1Om8P6aA-1; Tue, 07 Mar 2023 09:36:54 -0500 X-MC-Unique: XW0v8MhWNSK-ZY1Om8P6aA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2F8D0183B3C1; Tue, 7 Mar 2023 14:36:52 +0000 (UTC) Received: from vschneid.remote.csb (unknown [10.33.37.13]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A2870400DFA1; Tue, 7 Mar 2023 14:36:40 +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 v5 4/7] irq_work: Trace self-IPIs sent via arch_irq_work_raise() Date: Tue, 7 Mar 2023 14:35:55 +0000 Message-Id: <20230307143558.294354-5-vschneid@redhat.com> In-Reply-To: <20230307143558.294354-1-vschneid@redhat.com> References: <20230307143558.294354-1-vschneid@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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?1759721079932784371?= X-GMAIL-MSGID: =?utf-8?q?1759721079932784371?= IPIs sent to remote CPUs via irq_work_queue_on() are now covered by trace_ipi_send_cpumask(), add another instance of the tracepoint to cover self-IPIs. Signed-off-by: Valentin Schneider Reviewed-by: Steven Rostedt (Google) --- kernel/irq_work.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/kernel/irq_work.c b/kernel/irq_work.c index 7afa40fe5cc43..c33e88e32a67a 100644 --- a/kernel/irq_work.c +++ b/kernel/irq_work.c @@ -22,6 +22,8 @@ #include #include +#include + static DEFINE_PER_CPU(struct llist_head, raised_list); static DEFINE_PER_CPU(struct llist_head, lazy_list); static DEFINE_PER_CPU(struct task_struct *, irq_workd); @@ -74,6 +76,16 @@ void __weak arch_irq_work_raise(void) */ } +static __always_inline void irq_work_raise(struct irq_work *work) +{ + if (trace_ipi_send_cpumask_enabled() && arch_irq_work_has_interrupt()) + trace_ipi_send_cpumask(cpumask_of(smp_processor_id()), + _RET_IP_, + work->func); + + arch_irq_work_raise(); +} + /* Enqueue on current CPU, work must already be claimed and preempt disabled */ static void __irq_work_queue_local(struct irq_work *work) { @@ -99,7 +111,7 @@ static void __irq_work_queue_local(struct irq_work *work) /* If the work is "lazy", handle it from next tick if any */ if (!lazy_work || tick_nohz_tick_stopped()) - arch_irq_work_raise(); + irq_work_raise(work); } /* Enqueue the irq work @work on the current CPU */