From patchwork Wed Nov 2 18:33:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 13028797 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0A52C43217 for ; Wed, 2 Nov 2022 18:36:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xS9YQiL0yloP1W5M12QqcDMssNP6UpiFUbxz0DfLY0M=; b=Ove5HBobn1lcig hQrLV6bsMKf6lt80yxcf0K/J6z2N1M+0lj8LwKje7pyQUNoCmfEOlxGbYRIRPDAEKnJTbwiqs0SQ+ i2+w45uwnHnL9+W9BJnOf0+q8cR2vSMRY/9ONzOaW/Vvu17p5UAevf3Rq1F56+DlQIZp+B3UZ6oV1 3ocXH9zrttkP3Di4MlsV9Ojw42aPCCGCM8NO81AhPRG9w83SbKfdKrUz0U8d/smHo9U3ZSqZ1cKly tFozRxdcuuOqbV0zjtqO15bfvJTeVsUVnoYfMxgvy13YM5KuHVdl+00Nu2JGe80bzIC4ZaFat4fQC ZTf9AO99u1XLAngWrjIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqIaU-00D7JB-On; Wed, 02 Nov 2022 18:35:43 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqIZO-00D6V3-O2 for linux-arm-kernel@lists.infradead.org; Wed, 02 Nov 2022 18:34:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667414073; h=from:from: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=vPxNJZ59dAj9Aw/rnn/vqSwo8b8sDM1O6Xi76OwhNZs=; b=cDBe75sOs4UEKn9lTvRmqudIwlVBf/4cksxvayB8D+bxnTjGPyzYRZ/chtODx8k5kGTdAS LoO9f4+QMALszoN7lvfYHGJDFqQK5LtgRo/c/fJLynInRDpHc1zyc9ntUjpSBT25lrBkje gzSotb4hVRghBjTyJLyq6BnHBvEc9Yc= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-282--zReUpwzNAOgk7D-m73zYQ-1; Wed, 02 Nov 2022 14:34:25 -0400 X-MC-Unique: -zReUpwzNAOgk7D-m73zYQ-1 Received: by mail-qv1-f69.google.com with SMTP id q17-20020a056214019100b004b1d3c9f3acso10382179qvr.0 for ; Wed, 02 Nov 2022 11:34:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vPxNJZ59dAj9Aw/rnn/vqSwo8b8sDM1O6Xi76OwhNZs=; b=Cw/2jQZpJu9pCtgoY+htyfNHU3WA0yEgGjHGnxfz+mMBjEAAlOLJdlIrw9qVIUP7Nw 36H7DB/Ouen+Bo0p+/N3ZRtnvkTAS2NlXurd4bVo+tQA1TYJmCg6i0WTNLgr520BBlBE LzE6oNqEPSTatChcbzOhqnElIy2MGLSlEUzAPvxmbf+C3AtLN/IFUhg3e40ZeOo1D4lr 8fyGB4WCc2sTuGPeBtfLm0DOxIOlXaCsAfduHKXm6sbPyhR1fFoPzPA1veCKPzYH4jfR 6uceqeNZ7fNheKRqAcRby/fOY/wox7F1IPa0wZWn5tqxGVuqytGGVcVE4AgBh4MHgkrn 8Drg== X-Gm-Message-State: ACrzQf1pW4zSIWtuTRHA4W6Hj2I6Wq2CmcHaqBY2QeMMxxHtXmEov+sU 5pLtlIRITwb58aM8puJT876JzS7jCo5duWIrScWpygmt6R72xrCB6IXa3wHGrDM4QS0Kn3twhFu jq9xMgsssra0Ng6rQQloixS+c61PsRe4JhB0= X-Received: by 2002:a37:92c6:0:b0:6fa:28b2:1e2a with SMTP id u189-20020a3792c6000000b006fa28b21e2amr13574192qkd.9.1667414064982; Wed, 02 Nov 2022 11:34:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4EXOUjNlIxUYR8PDvF9w7H8/QWuUsvimzUEYEqnOFqRnuqhuZtDCzI4Vu/740apEttSzlakQ== X-Received: by 2002:a37:92c6:0:b0:6fa:28b2:1e2a with SMTP id u189-20020a3792c6000000b006fa28b21e2amr13574163qkd.9.1667414064758; Wed, 02 Nov 2022 11:34:24 -0700 (PDT) Received: from vschneid.remote.csb ([149.71.65.94]) by smtp.gmail.com with ESMTPSA id w187-20020a3794c4000000b006eed47a1a1esm8757820qkd.134.2022.11.02.11.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 11:34:23 -0700 (PDT) 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: "Paul E. McKenney" , Steven Rostedt , 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: [RFC PATCH v2 5/8] irq_work: Trace self-IPIs sent via arch_irq_work_raise() Date: Wed, 2 Nov 2022 18:33:33 +0000 Message-Id: <20221102183336.3120536-4-vschneid@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221102182949.3119584-1-vschneid@redhat.com> References: <20221102182949.3119584-1-vschneid@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221102_113434_897494_F02819D7 X-CRM114-Status: GOOD ( 17.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org IPIs sent to remove 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 --- 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..aec38c294ce68 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 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 */