From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F50CC433FE for ; Fri, 18 Nov 2022 16:43:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235186AbiKRQns (ORCPT ); Fri, 18 Nov 2022 11:43:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241647AbiKRQnp (ORCPT ); Fri, 18 Nov 2022 11:43:45 -0500 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 10C3593CE0 for ; Fri, 18 Nov 2022 08:42:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668789760; 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=iCeupirs0oRwfAYdrtKDNR33oxtw0kRHF9WhmcxURbs=; b=is4sSZobXPguOsrAJb7JAyhMO5SpS8UcYWAE+R5d34fjCAKvqtZg6QBIcFoLw5h6mr3RCt 5EPAB+vTGhKztvDccZH+7yoUS2r4oeOVsIgMWRoR4f+xF1kMvXGjusdUOr+rokCcXgyAxz YUK1G/bzc2+QiGQxJI9KYRjL7cpX4AI= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-486-COQ2a1lXPdS-Va1eb4_zwQ-1; Fri, 18 Nov 2022 11:42:38 -0500 X-MC-Unique: COQ2a1lXPdS-Va1eb4_zwQ-1 Received: by mail-ed1-f70.google.com with SMTP id c9-20020a05640227c900b00463de74bc15so3309627ede.13 for ; Fri, 18 Nov 2022 08:42:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iCeupirs0oRwfAYdrtKDNR33oxtw0kRHF9WhmcxURbs=; b=3LalUotuoWCtH8PmbaMt/IqqbLG7Iz+hf4CU78Fm86EjnQIhnm0K2iWgEED3qkHU/M 3ImIEZcA1xlZlMUBgPsNWiWb07yhb8QKauRrkf/9Qt/f81bQ51+QbJJk5DNeL7vAgUn4 oTz1BwC3rV0PeeiHHCeEhU/IOMFARYzDykDe6kYTd8cQNmjRF9qF1Q/wF7zFrw1QR8dw f2eyfZB0UmVBGUVjAOe6YfD0TluFhQaBO879R29NFVSSPhhwJFjF9IPAHJzn/VlNPST2 fLxwijoJmf3rIiK2R+F6jQkx2FB0JaqAeWZzpM11EBrQ+32S19eqm3osxwhfGUbhXykV ceLw== X-Gm-Message-State: ANoB5pllW+T86d//+IQaoDVDp/z8cVnEWGocPmlSjC3c1rEAaioYveMa QurPtRISKbIjPvXPAoi96Bt+4Tg+YhW5xaWt7MDTbNtYLV53g6LdST6x8zEVDmHkIGNPhoa2HEA eV6uaE5lggqKDVG+T6QsNDw== X-Received: by 2002:aa7:d4cf:0:b0:461:a9ce:5408 with SMTP id t15-20020aa7d4cf000000b00461a9ce5408mr6997407edr.201.1668789757505; Fri, 18 Nov 2022 08:42:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf5TaV9WywAgyEkJUjIKk83rbFXBQR8khfDHnlKNNSiUU8k8aohx0CjQn5lly7hEq5+W3BWrVw== X-Received: by 2002:aa7:d4cf:0:b0:461:a9ce:5408 with SMTP id t15-20020aa7d4cf000000b00461a9ce5408mr6997376edr.201.1668789757207; Fri, 18 Nov 2022 08:42:37 -0800 (PST) Received: from [192.168.0.46] (host-95-248-159-81.retail.telecomitalia.it. [95.248.159.81]) by smtp.gmail.com with ESMTPSA id b10-20020a1709063caa00b0073d83f80b05sm1912134ejh.94.2022.11.18.08.42.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Nov 2022 08:42:36 -0800 (PST) Message-ID: <1ab5082c-bec5-53f2-501b-f15f7e8edbd9@redhat.com> Date: Fri, 18 Nov 2022 17:42:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [RFC PATCH v2 8/8] sched, smp: Trace smp callback causing an IPI To: Peter Zijlstra , Valentin Schneider Cc: 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, "Paul E. McKenney" , Steven Rostedt , Thomas Gleixner , Sebastian Andrzej Siewior , Juri Lelli , 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" References: <20221102182949.3119584-1-vschneid@redhat.com> <20221102183336.3120536-7-vschneid@redhat.com> Content-Language: en-US From: Daniel Bristot de Oliveira In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On 11/18/22 10:12, Peter Zijlstra wrote: > On Thu, Nov 17, 2022 at 02:45:29PM +0000, Valentin Schneider wrote: > >>> + if (trace_ipi_send_cpumask_enabled()) { >>> + call_single_data_t *csd; >>> + smp_call_func_t func; >>> + >>> + csd = container_of(node, call_single_data_t, node.llist); >>> + >>> + func = sched_ttwu_pending; >>> + if (CSD_TYPE(csd) != CSD_TYPE_TTWU) >>> + func = csd->func; >>> + >>> + if (raw_smp_call_single_queue(cpu, node)) >>> + trace_ipi_send_cpumask(cpumask_of(cpu), _RET_IP_, func); >> So I went with the tracepoint being placed *before* the actual IPI gets >> sent to have a somewhat sane ordering between trace_ipi_send_cpumask() and >> e.g. trace_call_function_single_entry(). >> >> Packaging the call_single_queue logic makes the code less horrible, but it >> does mix up the event ordering... > Keeps em sharp ;-) > Having the trace before the IPI avoids the (non ideal) case where the trace stops because of an IPI execution before we have trace about who sent it... :-(. -- Daniel