Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1020848pxp; Sun, 20 Mar 2022 03:58:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw21F1hLGcuYCtJkr/UoZdwbhJc38fnLav5CpIbnw6RbT1fpN07mCG1oZhXPpp59c26y3sP X-Received: by 2002:a05:6402:845:b0:419:7b6:2e9b with SMTP id b5-20020a056402084500b0041907b62e9bmr12405528edz.283.1647773934954; Sun, 20 Mar 2022 03:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647773934; cv=none; d=google.com; s=arc-20160816; b=gSZ5Co/SJxskI0VVj9lR8vpg6YPk8tHKpSmZH/hWW1/QBpLKulrTptlhvvTOaYWVz7 1ti0g10HWZhkVzhn6gWyeU19lbx+OGmBy1mYFH6fSeyPh7Xsurdc9UmajDNoxvzb0Z6r Kh6iuTkvd4QTWQxrzaLSntV0VAyzZWG3IN6mjdgblnN5fRqvL6xcRuAR11WMg1e/LO41 aFbs/RT1gD7uDAd6lHkjwQnpc6/xLbXUaa7BDvfPuHBNi/1qpBOqhAZhyoHGFyWDW0Jy xRNos8mPhhgGkwKrTtc4GfRmZDR25ykc40wsFmfup8yZs7V7qH1QcE8c9u6I0slKmp+j miTQ== 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:subject:cc:to:from:date; bh=LHrTRMp7ci/YbQxaetWDdFrFDtjEwdgqlI8l8r67SNo=; b=R4cDWjxXN6Mrh/JVFeKB7yoW6xbNAUq88E980TjlePUSW1ykFjYxJ421gr1nDeE2ew s1Vj9LO6eVNvXkWbos1dtYXqnWjlq7YkdzDr0OnR8sT7iG1Ah0Kri//bEmiYciUiEFP6 tQJCEk8n8H7JoJ8ljUgzUzznjPxIqx1INEr0fqimT7UBtghJDnMHyd/dTrMYWQVO5gMF SxAtZpLkRnNC8EFzODFJ82/geWj4b3R+PVq35m5dcGM45z2bBbvLnzPvv3qyZFxCQ5Ug bWld93iT4nutPhhtTs8b0Z0GRCWmfB03eMId3rQymXh17PqPBADdu1MJ6XMQ+84S0btv bBzQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i10-20020a1709067a4a00b006df76385b80si5111900ejo.32.2022.03.20.03.58.27; Sun, 20 Mar 2022 03:58: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241249AbiCRWJR (ORCPT + 99 others); Fri, 18 Mar 2022 18:09:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233782AbiCRWJQ (ORCPT ); Fri, 18 Mar 2022 18:09:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BA921AD99; Fri, 18 Mar 2022 15:07:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E91DCB825D6; Fri, 18 Mar 2022 22:07:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CF76C340E8; Fri, 18 Mar 2022 22:07:51 +0000 (UTC) Date: Fri, 18 Mar 2022 18:07:50 -0400 From: Steven Rostedt To: Namhyung Kim Cc: Peter Zijlstra , Boqun Feng , Ingo Molnar , Will Deacon , Waiman Long , LKML , Thomas Gleixner , Byungchul Park , "Paul E. McKenney" , Mathieu Desnoyers , Arnd Bergmann , Radoslaw Burny , linux-arch , bpf Subject: Re: [PATCH 2/2] locking: Apply contention tracepoints in the slow path Message-ID: <20220318180750.744f08d4@gandalf.local.home> In-Reply-To: References: <20220316224548.500123-1-namhyung@kernel.org> <20220316224548.500123-3-namhyung@kernel.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Fri, 18 Mar 2022 14:55:27 -0700 Namhyung Kim wrote: > > > This looks a littl ugly ;-/ Maybe we can rename __down_common() to > > > ___down_common() and implement __down_common() as: > > > > > > static inline int __sched __down_common(...) > > > { > > > int ret; > > > trace_contention_begin(sem, 0); > > > ret = ___down_common(...); > > > trace_contention_end(sem, ret); > > > return ret; > > > } > > > > > > Thoughts? > > > > Yeah, that works, except I think he wants a few extra > > __set_current_state()'s like so: > > Not anymore, I decided not to because of noise in the task state. > > Also I'm considering two tracepoints for the return path to reduce > the buffer size as Mathieu suggested. Normally it'd return with 0 > so we can ignore it in the contention_end. For non-zero cases, > we can add a new tracepoint to save the return value. I don't think you need two tracepoints, but one that you can override. We have eprobes that let you create a trace event on top of a current trace event that can limit or extend what is traced in the buffer. And I also have custom events that can be placed on top of any existing tracepoint that has full access to what is sent into the tracepoint on not just what is available to the trace event: https://lore.kernel.org/all/20220312232551.181178712@goodmis.org/ -- Steve