Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp914567rwb; Fri, 18 Nov 2022 09:54:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf66VMjsP/wbS4UKM6AV9ydhJ5APIYtM0Qzmww59aJ0fIypb/Xsfp4PJ6We5/peLC4u2GWur X-Received: by 2002:a17:906:4e4e:b0:7ae:e6ac:2427 with SMTP id g14-20020a1709064e4e00b007aee6ac2427mr6923530ejw.345.1668794096798; Fri, 18 Nov 2022 09:54:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668794096; cv=none; d=google.com; s=arc-20160816; b=VK9IhsWfwhC0lvfNtsnZlA1oMt0WygiD0k9gCI7Q5SCIMRuh2gfcDVj0DdC7UcG/iw PGpFb2Ov0UOzm28bSpBqfoxfPDvsNnZ5OuIJgjEPuYwHaML4laXHxsHoOH0UEzxImNQd hsa1YZ6I/kWjZGKOmdyB+c6kvwEIEidQaxTIglZ1VmDN9joDOFUpC5qrWVkIOm6wdXby Dxa8wUCavmBbGOR34ZLcb74hukA91ONOsBtWgQ+bhAi77PFC6qUo7RenKDzsPp47wDa+ RXoICGtHOVHl6tf23E1qFNVmJOh7GZ48lzxOhM+doa25kaUGBGk2/lSh46eAHV7z2h86 33dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=iCeupirs0oRwfAYdrtKDNR33oxtw0kRHF9WhmcxURbs=; b=BcruwaJ5Ls7riqkTN3f07XD+Mw9TeWkngJdOQFscJ7CQtXH+M/vhpeev6em6uiHPex KCks7PCcgVuG4FKWJlPECjtJdbnGGxzlKfAUPXqn40amuHjTJ6pyukzvBUbJGX1Q3bD3 wK0decVpsNFSN1GG03kj3hlPmmHclNNZZ8S7n+NmDxU8saIR39DkWw3eLgTXdIsEBns2 BKYFe6+dw56VtPgM9dQ7asT01LYSw5Kn8IhB9X1uHjb1/4pcRcLYzeFwHnAqhFKSJ0xq KDyrVRTIudNbWnkzXrHc3I//U8jlB4JEXT7OPZmPPK/wXLMiwdfo/KsBhI0oA+FB4PiT bRQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=is4sSZob; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cr12-20020a170906d54c00b0078d2197d670si3325226ejc.661.2022.11.18.09.54.34; Fri, 18 Nov 2022 09:54:56 -0800 (PST) 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=is4sSZob; 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 S242218AbiKRQnp (ORCPT + 90 others); Fri, 18 Nov 2022 11:43:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242215AbiKRQnm (ORCPT ); Fri, 18 Nov 2022 11:43:42 -0500 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 E8D7A8CFDB 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-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-157-5-mcFXNHO2ir9PqTc0NyFg-1; Fri, 18 Nov 2022 11:42:38 -0500 X-MC-Unique: 5-mcFXNHO2ir9PqTc0NyFg-1 Received: by mail-ed1-f69.google.com with SMTP id e15-20020a056402190f00b00461b0576620so3250184edz.2 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=DTd2EtbGWXouMjLKlCXiN5qLJl7NFX4OclKjjdK8F9FGfM07yXZhvkkq+pqVdyadxR k/PzfkCNihmtw8SpLIwkYDMQ4XWMdxfD8SC/RBoKhKdSd1ZMRSne2j+4hnrFJPvd4GDE HENLMH42eBx/5UrUFP0uIONAkp7GYVNknlDs5LgLW3zBOsCnLKzc/0xNwcIeyUZJKA28 QrCKgiUzso7P6p7X6xSpqMFzdH7Jsp82lfcrnOeE+PJWFn6WwBBYQ4mbmNfguFy1Wn5W e0KSfk3kppUANtDvRsPPMocKh5z2IF1j9CVNlALjIGWDVt8Ey8PdudABQ9k4UlDpEOIm ODZA== X-Gm-Message-State: ANoB5pmFBnQRJU132rxNA/4BXYT7Ts3G388OTzZPSo23CzgPebtSQSej 0nEUqaGcJ4U9QJzI/xtSonVV1Ryt3ndEoihwlrJnaCsu1w2NacWNleCF0qJ6gISotChwHcT05sS 2MHC0+Yqm2b5ydMPAetSJTc3G X-Received: by 2002:aa7:d4cf:0:b0:461:a9ce:5408 with SMTP id t15-20020aa7d4cf000000b00461a9ce5408mr6997424edr.201.1668789757507; Fri, 18 Nov 2022 08:42:37 -0800 (PST) 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 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