From patchwork Wed Nov 2 18:33:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 14443 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp72405wru; Wed, 2 Nov 2022 11:36:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7t8FSNd8XQM12I59/zolTgcj42RNNTXuXsyZ94qQw4DdQvh9o6Mqr9yLQXd/J2Ol5KLrJc X-Received: by 2002:a17:906:c151:b0:78d:cdbc:9fb7 with SMTP id dp17-20020a170906c15100b0078dcdbc9fb7mr24376483ejc.688.1667414214729; Wed, 02 Nov 2022 11:36:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667414214; cv=none; d=google.com; s=arc-20160816; b=N/hDeZ7drPEHkJvwKj9cMBUY7XWgjlKKIuZoXbhgL+q7ja5Uh3hu5Yo1YqZm5z8X5B kg/4f9wc5Mz5Eg+1E8/uiI1a5VV06R0zK5RZ1gBcQBV96owVTVwVO1Wo++9e/XcISd+1 hdcvCzkXvEpVFhZ4B/0mWdo/wv25LJLGBfZjtGTi0AmRwfVRzY3vcQARUfOcwmc5TSo+ MKQN/ajKVo11iScxYumAjtJ57PTwz0ha7Sz3UVWDzwgz3qBpvkimV+yYrIqPDab9XGWq ayVQPbIMp/wbtIEtcO5jHqUZFT9hlCWxpd3sPiR18bSsufB84IybMEJ01sd3Hced5+k8 y1eA== 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=Q2c/WKPv2c4lGzoV4BgFlQ86HvvMif9SoXjhbRICEmY=; b=sDzVhmXvzr8yitLJ0e/8wE2aWR/iUie2y5uAe69n4BKiETgQn62LxjjdO/Tdtc+PNm pixXTRkb1v5FUYUx8OP86PBethP93qWx+ZIAwg/taNSi1TvzfwKWRbAl1dHR4QXO99Yz 3UyVUL8TplmRCnz/fbL/87S81R8dN/IZPIITwWow+0otmMgiiwq9InDMau2/0F3af7Us AOY0BD8rPwnc9ZVCPTIqIPtHGUsLf8hRMm728+24KsNZj2V4a92d7Kt11GpauWPT0X9R eLUM99ZJTadfe7yq10aV8cQw47qM1cuWaH3YNPWda9N5uFoCDP9/lPNQacPpyqHuS9Xt sgrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Cr7HY3/P"; 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 c17-20020a05640227d100b004594b742e0asi17979501ede.323.2022.11.02.11.36.29; Wed, 02 Nov 2022 11:36:54 -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="Cr7HY3/P"; 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 S231128AbiKBSgU (ORCPT + 99 others); Wed, 2 Nov 2022 14:36:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230115AbiKBSgH (ORCPT ); Wed, 2 Nov 2022 14:36:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B1E62F03B for ; Wed, 2 Nov 2022 11:34:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667414055; 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=Q2c/WKPv2c4lGzoV4BgFlQ86HvvMif9SoXjhbRICEmY=; b=Cr7HY3/PTYMoiLCtWF3OILk+jK247slAYP4UxXg83f6eOb0Rt9lfd/FtEiAu6MdYMasekw incsXoLXPMGqmxC84m1vayeQ99nMS6DxpPGzjKrAnViPAUwZeUxwHK92LRMcf0+DJVxKY5 JYw7GMeK9tmdPWZE+mLU/m4jWMVcrXk= 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-319-njuIbgLNNNGf68tcxV-bUw-1; Wed, 02 Nov 2022 14:34:14 -0400 X-MC-Unique: njuIbgLNNNGf68tcxV-bUw-1 Received: by mail-qv1-f69.google.com with SMTP id ng1-20020a0562143bc100b004bb706b3a27so10558577qvb.20 for ; Wed, 02 Nov 2022 11:34:14 -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=Q2c/WKPv2c4lGzoV4BgFlQ86HvvMif9SoXjhbRICEmY=; b=gDQ4sR11+dXMTyEt79g7DPztLlesMqWBqLY+69rkOvP/LwyHZdCFs6fz55RlPUeJOY niuHOJslybRhqofeHor3z3Arg+vXPmCv5PVRmJZOTk/709LrMy+2VJZ1WKyxKlRjT4gT LWpbmbsBECqL/zIEhsooL7gulJtWlAzdF7p+iCBX6jPkUhDHl22CH1FtUau1VKmpI7Nt Fey6dg0aRw6GwgwxKT2uvjVaqDNdeMkohhvAAO9h9wWIBXLwOCQalke4dbFeKRisGmOw nbaYDHProfDxWsJTAHZRSK0yL4goA01aCp18kyBiNWLbBDYOS8gvxwwXEk7FjiqI3vGD rTbQ== X-Gm-Message-State: ACrzQf1bTbbzTsRK1sqm0keGUdMEXim5tqON4+iXBuPtbxQ9b47p/QTm 7MDgCYp64ewCyEP8oPbqiD04wqygNYjTodaIBjic63moMZIcd0rwhXbERvWM5xgkjYMgHa314pu tGgGVzyN3Tbc/7UZqZMcTd8aR X-Received: by 2002:a05:6214:2301:b0:498:9f6f:28d with SMTP id gc1-20020a056214230100b004989f6f028dmr22639706qvb.5.1667414053972; Wed, 02 Nov 2022 11:34:13 -0700 (PDT) X-Received: by 2002:a05:6214:2301:b0:498:9f6f:28d with SMTP id gc1-20020a056214230100b004989f6f028dmr22639668qvb.5.1667414053726; Wed, 02 Nov 2022 11:34:13 -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.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 11:34:12 -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 3/8] sched, smp: Trace IPIs sent via send_call_function_single_ipi() Date: Wed, 2 Nov 2022 18:33:31 +0000 Message-Id: <20221102183336.3120536-2-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-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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748410527702099749?= X-GMAIL-MSGID: =?utf-8?q?1748410527702099749?= send_call_function_single_ipi() is the thing that sends IPIs at the bottom of smp_call_function*() via either generic_exec_single() or smp_call_function_many_cond(). Give it an IPI-related tracepoint. Note that this ends up tracing any IPI sent via __smp_call_single_queue(), which covers __ttwu_queue_wakelist() and irq_work_queue_on() "for free". Signed-off-by: Valentin Schneider --- arch/arm/kernel/smp.c | 3 --- arch/arm64/kernel/smp.c | 1 - kernel/sched/core.c | 7 +++++-- kernel/smp.c | 4 ++++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 978db2d96b446..3b280d55c1c40 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -48,9 +48,6 @@ #include #include -#define CREATE_TRACE_POINTS -#include - /* * as from 2.5, kernels no longer have an init_tasks structure * so we need some other way of telling a new secondary core diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index ffc5d76cf6955..937d2623e06ba 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -51,7 +51,6 @@ #include #include -#define CREATE_TRACE_POINTS #include DEFINE_PER_CPU_READ_MOSTLY(int, cpu_number); diff --git a/kernel/sched/core.c b/kernel/sched/core.c index cb2aa2b54c7a4..02181f8072b5f 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -81,6 +81,7 @@ #include #include #undef CREATE_TRACE_POINTS +#include #include "sched.h" #include "stats.h" @@ -3746,10 +3747,12 @@ void send_call_function_single_ipi(int cpu) { struct rq *rq = cpu_rq(cpu); - if (!set_nr_if_polling(rq->idle)) + if (!set_nr_if_polling(rq->idle)) { + trace_ipi_send_cpumask(cpumask_of(cpu), _RET_IP_, NULL); arch_send_call_function_single_ipi(cpu); - else + } else { trace_sched_wake_idle_without_ipi(cpu); + } } /* diff --git a/kernel/smp.c b/kernel/smp.c index 06a413987a14a..e2ca1e2f31274 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -26,6 +26,10 @@ #include #include +#define CREATE_TRACE_POINTS +#include +#undef CREATE_TRACE_POINTS + #include "smpboot.h" #include "sched/smp.h"