Message ID | 20221102183336.3120536-4-vschneid@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp72945wru; Wed, 2 Nov 2022 11:37:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5L9p7klgiQZMIQwzPUKOtxeVpeSeZD+w16/iLD27igkpo/TbCXUOyUl9Fzlx2O3BNOZcen X-Received: by 2002:a05:6402:3512:b0:461:e146:d2e7 with SMTP id b18-20020a056402351200b00461e146d2e7mr26168434edd.39.1667414277871; Wed, 02 Nov 2022 11:37:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667414277; cv=none; d=google.com; s=arc-20160816; b=sVujU0g1rmOg785m+wqd2sRDO7VaW8jXOosBTCQMqa+S4np0JpqlV60CMAM+O5dP9B PzBnDlvzpadTLwcZkUX6pTFmBNIAon1qo62w6/jK7JPb0EuquKLz+X0EJq4w8BRPc6P/ RjLntTEnEGCbqA+qQuU4ng2Farw6OpBxswV6vMC6Y7PKmt+L+Vri+EzPaN05+ava0Ry0 OggoZiL72B+17O+mrG9VZeog2CeAjfahlti/cnAN451+rS+3WMuqg1+02FbKADek03lB qv/WGErsMBl3K1FABk7zLxM8l4K5dG80t0rIQnv08x2p09oM4cEzcnM+z953KBl3iLlZ KObA== 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=vPxNJZ59dAj9Aw/rnn/vqSwo8b8sDM1O6Xi76OwhNZs=; b=LFgsBbOF8ZhHRXAGZm1+zMeuJSKwMwuQvQrE1h9UFsWbtaaz4plmSZqTub5yTVsmRT Vd320deBhNQcAXK6Uj7uIC8eyxpTnqqICvweKIm+RN5LmEgLoV6t3kQUM3EJnbLU0EnC xjXNrOKzY3e5Uz4v+ymOAuZqDO1I7c2gIfm4GgWDbWzh3XqVsVrWpGCz2DMDeZsVsaUm 7MAyNoSV4wpjI2jJHZ4j7N8Gl2ZjBC2vUQsDrvdA23Wy7v2oyir0VpbttOyMxdhz/RZ4 8uOzZJDrWfJ6DXrJoESmek5JJQR7Q9yk4QzSo4Cj0U5NaV6DnjC0BDwblpcC4IACxy+p D21A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="L/8+QVXW"; 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 d7-20020a50ea87000000b0045cd7614e59si14964292edo.451.2022.11.02.11.37.31; Wed, 02 Nov 2022 11:37:57 -0700 (PDT) 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="L/8+QVXW"; 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 S231226AbiKBShV (ORCPT <rfc822;yves.mi.zy@gmail.com> + 99 others); Wed, 2 Nov 2022 14:37:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231465AbiKBShH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 2 Nov 2022 14:37:07 -0400 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 531D82FC1B for <linux-kernel@vger.kernel.org>; Wed, 2 Nov 2022 11:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667414066; 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=vPxNJZ59dAj9Aw/rnn/vqSwo8b8sDM1O6Xi76OwhNZs=; b=L/8+QVXWBbfiZ92AeTl7/2LbksdpihZV1psDO5gjVTnM+4vDSA87xZ5/fQJ8YOL+ULZv1B Z3o3AjwtimKYjiRnBM4Mgxu7kjtLRolsZoSv3iysrHhBzkOr3dArOdK/aPh8wu89zvSS+3 oCZ6FRgBDL160DtPy8KgcqyH5Q8HFUY= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-22-QCyWEDw8MeCPYM6gnu_lmw-1; Wed, 02 Nov 2022 14:34:25 -0400 X-MC-Unique: QCyWEDw8MeCPYM6gnu_lmw-1 Received: by mail-qv1-f72.google.com with SMTP id x5-20020ad44585000000b004bb6c687f47so10381046qvu.3 for <linux-kernel@vger.kernel.org>; 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=2Hsh3dvf3cuUmJnLbbmyDdRNYQeFE1L2pd0AaHFpyPAYwgJ5Rj8y50BWZVSLg55Hjo E/ViWSKsWUFx6hH/MwNK+vLl4k8C66odJD44dZcMawM8hWzRoOznXBCK3XMFQ86bhZmF tNuhS/NkvhcsnYoNs2lWYnE2UxeIP5VZcdPSKMf888J4pvr5+ZtJQ1lFrgfGmOAljA8X DEMtXpoE1e+8J+oBQg4ckQDep0P1KIsKTcRCaH5YbVACbIaPsLS0fbuBFBGA3MYN8j1V qsNhWuTG+7MMmRc6J25XdTgXewVsn+Vpajk/yQyVjQfQopRKwH16YGgKVcXCs513bJjz YxGg== X-Gm-Message-State: ACrzQf39V1WpW7i3hWw7qW3TtVGSySaTkVvkkZBoBy/X/q8oyAuegCFG y6TGT3HMlGX8cavEDS/6Zkc/cmQReaZZnxBkEK6ZPEyPqP83Dr1BRfhni1P7EA5nrhwWsA/qch6 HLSRPKkuJ9WdEolF+obK9+Mef X-Received: by 2002:a37:92c6:0:b0:6fa:28b2:1e2a with SMTP id u189-20020a3792c6000000b006fa28b21e2amr13574183qkd.9.1667414064981; Wed, 02 Nov 2022 11:34:24 -0700 (PDT) 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 <vschneid@redhat.com> 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" <paulmck@kernel.org>, Steven Rostedt <rostedt@goodmis.org>, Peter Zijlstra <peterz@infradead.org>, Thomas Gleixner <tglx@linutronix.de>, Sebastian Andrzej Siewior <bigeasy@linutronix.de>, Juri Lelli <juri.lelli@redhat.com>, Daniel Bristot de Oliveira <bristot@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>, Frederic Weisbecker <frederic@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "H. Peter Anvin" <hpa@zytor.com>, Marc Zyngier <maz@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Russell King <linux@armlinux.org.uk>, Nicholas Piggin <npiggin@gmail.com>, Guo Ren <guoren@kernel.org>, "David S. Miller" <davem@davemloft.net> 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748410593996597931?= X-GMAIL-MSGID: =?utf-8?q?1748410593996597931?= |
Series |
Generic IPI sending tracepoint
|
|
Commit Message
Valentin Schneider
Nov. 2, 2022, 6:33 p.m. UTC
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 <vschneid@redhat.com>
---
kernel/irq_work.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
Comments
On Wed, Nov 02, 2022 at 06:33:33PM +0000, Valentin Schneider wrote: > 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 <vschneid@redhat.com> > --- > 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 <asm/processor.h> > #include <linux/kasan.h> > > +#include <trace/events/ipi.h> > + > 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) __always_inline, unless you want to occasionally only see it point to __irq_work_queue_local(). > +{ > + 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 */ > -- > 2.31.1 >
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 <asm/processor.h> #include <linux/kasan.h> +#include <trace/events/ipi.h> + 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 */