From patchwork Fri Dec 2 15:58:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 28953 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp937984wrr; Fri, 2 Dec 2022 08:01:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf6kp6x3WYTQcX5CAdI+Mz/nXlyNmnqFNWsJ2c6MEO9TI5E0kOffIL4TNl41QJibCPkSPB+F X-Received: by 2002:a05:6a00:21c2:b0:56b:bba4:650a with SMTP id t2-20020a056a0021c200b0056bbba4650amr53335461pfj.4.1669996911890; Fri, 02 Dec 2022 08:01:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669996911; cv=none; d=google.com; s=arc-20160816; b=NYR6B0LhRqRMPszhJIKwJOGejKdtkpkOjW+pnKsPXJGNdUKhLOTn4hSXjsi4xMrQsI PjhCFZ7Cds35iGFGumfbVj9KGDUmszVkpp6qOSPru1aU0enFdp8H9Mr9JLyyZpohr8u5 J27qWdGWww/dHSDUFBChtAbeynGLQ5x4QN7uiGTQFWE55flw6N3VsleN7sq+XLocA5CK rMIFkDHu+8HikOKu/59m5N/rqOTxEdHbmOxenZO2ZchD3aqbL8zxYTY3I3nMeLo5Gg8p B3/ajBfN4OkL9WnqDgjHmUR915Z/yaszm2/cT0753i95L3kM83g2UiDvsblBmSUrvclN Tidw== 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=FTawqG5tHwrpxiNOOGNEstC4hFQ2mFWPjNq5o3hmUryh+Mp+HVoZToL910HIedzhbe wrgcF9sdK6gEswICzLZ1E3CHjbufovlUJVupve8mgaDCHrACYDhcV6f8eWr2xCoNQdRB R0yK2CGTbIfzFU2ncNPnoSZlriIhu4av7vKyObRf+5e7Vkj70GgAueeURLwF823QrIOc vyTvHiZhxEcQtA9qWQ2OOJJZz1/YzUMRWUcfcCojgPs0lerG6/YviYYkJPieImy8qssL PlUDbP05f4hwQh4kTYXjQL342Aj0e8xQa57z02ZTtcRGtJ1+SY//QOrybAI5FEMDHWJS h8Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OzouMb8y; 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 w7-20020a056a0014c700b0056aafb43783si8479751pfu.155.2022.12.02.08.01.37; Fri, 02 Dec 2022 08:01:51 -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=OzouMb8y; 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 S233884AbiLBQBL (ORCPT + 99 others); Fri, 2 Dec 2022 11:01:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233878AbiLBQA0 (ORCPT ); Fri, 2 Dec 2022 11:00:26 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4E09D1581 for ; Fri, 2 Dec 2022 07:59:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669996762; 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=OzouMb8yq8tuKd2KsA6W7WeRnK4mbl9f7FSgRmjVtOg6F4VOm7fsy58Kqc4ISmSeFBGYkH 27AWcdnSkk6dWrFw0yx78L6k+PwZexhTSpk0eG7THjQBtPHNVbUN6/KRf2qChlW8LA7Dj3 pvf6mPoHKPBXBXR6TBIwR1HRpaAYfR4= 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-594-Okj2luc0MBCEEYR4jqlogg-1; Fri, 02 Dec 2022 10:59:19 -0500 X-MC-Unique: Okj2luc0MBCEEYR4jqlogg-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 92E14101A528; Fri, 2 Dec 2022 15:59:17 +0000 (UTC) Received: from vschneid.remote.csb (unknown [10.33.36.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EAE2920290A5; Fri, 2 Dec 2022 15:59:11 +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 5/8] irq_work: Trace self-IPIs sent via arch_irq_work_raise() Date: Fri, 2 Dec 2022 15:58:14 +0000 Message-Id: <20221202155817.2102944-6-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?1751118681765472493?= X-GMAIL-MSGID: =?utf-8?q?1751118681765472493?= 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 */