From patchwork Tue Mar 28 08:34:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 75896 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2059257vqo; Tue, 28 Mar 2023 01:36:52 -0700 (PDT) X-Google-Smtp-Source: AKy350bVgArzH7TaNOqHpLrqe2/tMcl1g0+rzluA0DoGkGqVp4SdYTj7JqYLggE9FDHjJQECkz3Q X-Received: by 2002:aa7:961c:0:b0:626:2ab1:19a8 with SMTP id q28-20020aa7961c000000b006262ab119a8mr13491251pfg.25.1679992612413; Tue, 28 Mar 2023 01:36:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679992612; cv=none; d=google.com; s=arc-20160816; b=OyL7S3iQfNAw/p/4VUz8c0iexbb+HIM2JP9lBQYNOBhl3fC9n7ka3iDAotzynmZK8g s84WEgnF3Np+YtHf3xNQ9QdUgjAIm3EhJPhMAnPNPLch7C4ueeRp7v984cSqjRXxOKW8 +hofGPhq4GnVvRH2abSX8/xKKlspDq5fr4NZP9QHLqGasYmZ8DIBcT+CXTZHPrZChZXU utEfVilixod2jX+xFulfYfs8gO2ij4or/LoUq7Ps/5ywYqH/Q35BbFkQrRaB1TpL2mRK wpvLh7DsUSTZYq0hVYgk1cs9brsOf71yo5qGz+VHRXQlxpSqcKqeBORz+BdUfrYhT+lz wOXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=8m0BjTV4H8QXJz3U7MbSbwIQl4vClbzedXdI0q9vbk0=; b=WypVXXdhTfMnUj3TnLCfOtJffFyQMucnV1T1INFUymOn80CqyFkIOqJMYra7bhOVy8 Wgvfx9WRf54x6m72QNKjlIvQLS1yuniadCAYBYCZdqJE6CBC+rmD7IXN/+EbENSxGhdl QzT/WEy+123s2Ecywn3t7PNBJRCL3qD8f+zrKD8uOE1yQzLZAeVCcEjcyqFxkVKhvnzT WBa4jb/quGSD9UX6CIu35xWHIHCBHOgH1bKjxVoBhFlowqpURK4njoXWNMpEcWriBnwT iCcH17R1urvkdiI/UroPiV5PNWllqDpUr1YVUg4lQgMjKsFoMO+CWu81+88SINGMgrKw FpJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=A5Rs7ZlV; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f19-20020a056a00239300b005cd33628c0fsi30901521pfc.177.2023.03.28.01.36.40; Tue, 28 Mar 2023 01:36:52 -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=@linutronix.de header.s=2020 header.b=A5Rs7ZlV; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232542AbjC1IfF (ORCPT + 99 others); Tue, 28 Mar 2023 04:35:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232289AbjC1Ieu (ORCPT ); Tue, 28 Mar 2023 04:34:50 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABA9A420A; Tue, 28 Mar 2023 01:34:49 -0700 (PDT) Date: Tue, 28 Mar 2023 08:34:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1679992486; h=from:from:sender:sender:reply-to: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=8m0BjTV4H8QXJz3U7MbSbwIQl4vClbzedXdI0q9vbk0=; b=A5Rs7ZlVywkHISCBs2ltP5ZuEGo59QChlukr4iIaaJX1d9T/uqlOQFiIpIjaKLBCyRJ6Op 1APtDLAf7FyJsz7oqgfsxYbeMALBspyauPXQ0T2ivpRMkL7A+BEJwPJuoWLALGZZ7afU41 0f0hY7ynX1Ixrra4d8cvQlYeXGU7v4EAp5KF0wih/wnSCwqFilU+cgDlg5WCWRazI72zC5 pDoC6GSHWJurczQUTXmncQ78E1SheM2Hi4GH5KifQFdhsouTWcoh+pvvLugUHzNhDAKqkH FN8trF+9jLbYC5nFbN7T/DBq2dBYQ+ToqY4IRpYwry2oPykK6/DnBSgSfwnSLg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1679992486; h=from:from:sender:sender:reply-to: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=8m0BjTV4H8QXJz3U7MbSbwIQl4vClbzedXdI0q9vbk0=; b=68mO9lTUsCvowwnlL0b2hMymSZLqP9J9P6O3aIUHwg1WEQgsZQXIDF7JesH//x9s22ypRZ TxCn3p5D+MSW/DAg== From: "tip-bot2 for Valentin Schneider" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: smp/core] irq_work: Trace self-IPIs sent via arch_irq_work_raise() Cc: Valentin Schneider , "Peter Zijlstra (Intel)" , "Steven Rostedt (Google)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230307143558.294354-5-vschneid@redhat.com> References: <20230307143558.294354-5-vschneid@redhat.com> MIME-Version: 1.0 Message-ID: <167999248584.5837.2675247233861998370.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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?1761599933917494049?= The following commit has been merged into the smp/core branch of tip: Commit-ID: 4468161a5ca2ea239c92de7c0a0dca61854ec4da Gitweb: https://git.kernel.org/tip/4468161a5ca2ea239c92de7c0a0dca61854ec4da Author: Valentin Schneider AuthorDate: Tue, 07 Mar 2023 14:35:55 Committer: Peter Zijlstra CommitterDate: Fri, 24 Mar 2023 11:01:27 +01:00 irq_work: Trace self-IPIs sent via arch_irq_work_raise() 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 Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Steven Rostedt (Google) Link: https://lore.kernel.org/r/20230307143558.294354-5-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 7afa40f..c33e88e 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 */