From patchwork Fri Oct 7 15:45:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 13001252 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 17935C433FE for ; Fri, 7 Oct 2022 15:46:37 +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=CU1pSi/Mf0DrQjqZ5hCAmcD7OU2umaFSSLLUkxBjP58=; b=pwT89j3EyIZqX/ kM0Zo/txp9nafRjh9gn2Ec3X4qqBOR5s7u5oKX0c8U2TVwtGkb83ITBYKJwTObRtMTJRMxfOl3GKI wYaqbPpGvXUC6HwxVye3nNADKx3f3+N/z+KJkzMGi3a93RnZ7eiCUAsZrSn9r4S2PLD8XUvnqH05Q uuHPFIIZGiVrIWg8IcoB5PAgze6laS6f5ntc5otMaOWk3aPkXPuYOmgCLNxMHJj3KR2pWy6qKeDFX IdADkgtrr56BNwDHsDFIug53R8Pzbe49GgIyTpe0qU9FQJlX3AGB7bA/mOc7I8GQSYm3uFiE+lPGf k4w9xjz3n0UH8d+l13Ww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogpYQ-009YhQ-FQ; Fri, 07 Oct 2022 15:46:26 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogpYB-009YT2-7C for linux-riscv@lists.infradead.org; Fri, 07 Oct 2022 15:46:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665157570; 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=V8NlfJJNnBH1Hg+bNlEeNOaLSp643edXbrFkYOuHdj0=; b=bQ6hPGYo4FsYj8QPFvMdssGyeKTiMFuyGpseGcUi9Oz5qPshPYgmoNZvvM0C9Yy7STerd5 jO9HKBjAWMyU/b5ngjI6kx7AO/3SYiWmrLNLyzRjyKX7L2n6uJJVfClXAn6+9fSg0qTvQE Qy1MIzSF9ygKP5Lbmbgz3i4ytg0qX0E= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-161-dNaSK7zIMvGnmHmN1FmHHQ-1; Fri, 07 Oct 2022 11:46:09 -0400 X-MC-Unique: dNaSK7zIMvGnmHmN1FmHHQ-1 Received: by mail-wr1-f72.google.com with SMTP id d22-20020adfa356000000b0022e224b21c0so1563826wrb.9 for ; Fri, 07 Oct 2022 08:46:08 -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=V8NlfJJNnBH1Hg+bNlEeNOaLSp643edXbrFkYOuHdj0=; b=cSnpvyxq6q+W49zxjzBG6+nSfDlVaNdLrbht2EjuDIj1pV9wfsLzNC/vebueAZkTsE gBJynz1/DK/pfdX9kcGCbpzMFqQX/6UjTpMazmjXj0LiRG+8sfC/NDYh7MhR9BLBSnq7 7LwakXuFB4uXp1NsnKFfrFMXZCMne3tDBDs3UmbKUHsTLUfh+WsUNAHS0iNl2ho2KRt0 /Zho/fXaks5mvvjOovF8Xm/RitgxY6P/9IsQUvdrWvO2zDn/biQqAbQVtN7FWYZwrXw8 ex/vyyEnMEsJ+/pPePCDJhAIiiVFNg8mtOYFW0cpG/dC5McNH0yvfHKx9XLDYyOj3quw RA1g== X-Gm-Message-State: ACrzQf2KoKwo5Rz9oKFySESH9w5NmTo/coTlpWI15dX6f5Q1p80/Y92Z VJ59eHivL8dUKvkpZWOLa8wWM6eWO/yOl15SvEwKSbYn5uFWG3u3/jFT+8n/6e3zQRdzAejK4Su cxr5/eYeMaRArDqObnfVi+8VCoQ3s X-Received: by 2002:a5d:64cd:0:b0:22e:2fc1:9511 with SMTP id f13-20020a5d64cd000000b0022e2fc19511mr3566266wri.415.1665157568157; Fri, 07 Oct 2022 08:46:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4t9ram8oou3fr6TpdC1R8We+758fvnnqCUt2NCTCIakvPHOGi5POwCK/ARZj0LE9PFnGcXMg== X-Received: by 2002:a5d:64cd:0:b0:22e:2fc1:9511 with SMTP id f13-20020a5d64cd000000b0022e2fc19511mr3566217wri.415.1665157567961; Fri, 07 Oct 2022 08:46:07 -0700 (PDT) Received: from vschneid.remote.csb ([149.71.65.94]) by smtp.gmail.com with ESMTPSA id i18-20020adfb652000000b0022e38c93195sm2339428wre.34.2022.10.07.08.46.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 08:46:06 -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 4/5] irq_work: Trace calls to arch_irq_work_raise() Date: Fri, 7 Oct 2022 16:45:32 +0100 Message-Id: <20221007154533.1878285-4-vschneid@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221007154145.1877054-1-vschneid@redhat.com> References: <20221007154145.1877054-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-20221007_084611_364278_8E6ED4F3 X-CRM114-Status: GOOD ( 16.23 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Adding a tracepoint to send_call_function_single_ipi() covers irq_work_queue_on() when the CPU isn't the local one - add a tracepoint to irq_work_raise() to cover the other cases. Signed-off-by: Valentin Schneider --- kernel/irq_work.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/kernel/irq_work.c b/kernel/irq_work.c index 7afa40fe5cc4..5a550b681878 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,14 @@ void __weak arch_irq_work_raise(void) */ } +static inline void irq_work_raise(void) +{ + if (arch_irq_work_has_interrupt()) + trace_ipi_send_cpu(_RET_IP_, smp_processor_id()); + + 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 +109,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(); } /* Enqueue the irq work @work on the current CPU */