Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2294984pxp; Mon, 21 Mar 2022 16:08:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8q2yjhVf2cLO+NE5GPQSAiG5CUC5KIYsBrRgPg8rPxnW07UeZVSbvxNHizQ6mBMZ980e/ X-Received: by 2002:a17:90a:8595:b0:1bf:4592:a819 with SMTP id m21-20020a17090a859500b001bf4592a819mr1505464pjn.183.1647904124455; Mon, 21 Mar 2022 16:08:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647904124; cv=none; d=google.com; s=arc-20160816; b=yT+Bx2uc2pvQu0zMRO8Z8syRR1cQBnaRAtaGFX7aH2qK26ZNgWilsbxBnnr6o4oS7a BRKPaI2Mj8mphFef1mKuLmZsgUpOQN1be45eSaPoFTooymrfxsf+KxnM3kCRvCp6iT13 RGPw5DekuBZR6Pgm8hKumxCukY3iyZUYSf2BSzC7yhgjNlqr0r1ZjfOvETdBW8GNhY1H Gw48HLJ5fk55Kd0qnIFWO8Yca+BiCyfThbE07HRE6CZ20oPv8CYGKln6BxKaDIxmx6uw OMfYw3EkFam5vch0MiLMelvp+jz/JmCkWjdLJC20RVWinlzbI+q18EpH5TO6xzv0ytwm Ek/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=RefRx5po0WHZQRy5R4kPGcVNk3NZW9epOkJFzUWcdCM=; b=hX/B6OIrRisB+X4gGtcpdLoL9/Ro0RGQPHmQWEwYINWq640lNPPJDCJvY+qesbb7ej pmj2aU3YpWm4bNvtbkSjOo5igSWNUXgVa+6LMI17c++SUEuC58SKvW2qAbP1O8v6P6sg 5r+30Ke6DG/lWFyy9niHyHGnO7V7Kqi/rZ93dSy9LkO0ZRZ3vRtvYuRMWet1EI3GXOEr TiGHGrZLsJBh6eB9ar6LqgIGjJ0o1LQip/Y6+dCH6bONkbJ81LukF0q94RCzUoFIjs/P FufEVme3WmWjzlOZTHgjY/H6dg14RrvuTMwksP0daZOYn3he/tElX9x4o+GmZvjDsdho vUxA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h19-20020a63f913000000b003816043ee44si13948651pgi.57.2022.03.21.16.08.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:08:44 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 270643FD6F8; Mon, 21 Mar 2022 15:06:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241618AbiCSANa (ORCPT + 99 others); Fri, 18 Mar 2022 20:13:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235207AbiCSAN2 (ORCPT ); Fri, 18 Mar 2022 20:13:28 -0400 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 599B22F09FA; Fri, 18 Mar 2022 17:12:07 -0700 (PDT) Received: by mail-lj1-f180.google.com with SMTP id q5so13156665ljb.11; Fri, 18 Mar 2022 17:12:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RefRx5po0WHZQRy5R4kPGcVNk3NZW9epOkJFzUWcdCM=; b=voMGWsSsW9PVH18lzz2o1FiGKYOCoFdP9pYQCBJ5FloBVmP0kIQETHTirgBiOpXKCX u2OSEL1KPa+xzSWFKp+3HbIdpnSOtIXo2YbxjseCdkypWbxFyuRCGh5DFv/XqUcitzNk 1Qo+FS8Kn1zYtd0dB8bBTIdFJ0bDt2dkdlICEY4Iplgborrtyx3Q0oNy2DHU0DGdepxD GGpwjuKFjpbAwu1l1y8zjDK287CbmUP/9vUKFPv51CN63zwX46z6Apk8ZVuuwpmPxEQV oueQ4eYOfEd/6OvBuey2zhJyso6LWzB8W12BMRm7Bt7dc51qhhoeD5VDsSirZERqY/7R Osfw== X-Gm-Message-State: AOAM532qhM/xHEyc4VmlHUm99lfwsLbAFapv95lcwH93LzqS8G1smWvG XLXVjGKzH0Hwr+nLSUyykX/D5hmLNQ+AwGIb0k4= X-Received: by 2002:a2e:82c5:0:b0:247:e81f:8b02 with SMTP id n5-20020a2e82c5000000b00247e81f8b02mr7698337ljh.90.1647648725489; Fri, 18 Mar 2022 17:12:05 -0700 (PDT) MIME-Version: 1.0 References: <20220316224548.500123-1-namhyung@kernel.org> <20220316224548.500123-3-namhyung@kernel.org> <20220318180750.744f08d4@gandalf.local.home> In-Reply-To: <20220318180750.744f08d4@gandalf.local.home> From: Namhyung Kim Date: Fri, 18 Mar 2022 17:11:54 -0700 Message-ID: Subject: Re: [PATCH 2/2] locking: Apply contention tracepoints in the slow path To: Steven Rostedt 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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, Mar 18, 2022 at 3:07 PM Steven Rostedt wrote: > > 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/ Thanks for the info. But it's unclear to me if it provides the custom event with the same or different name. Can I use both of the original and the custom events at the same time? Thanks, Namhyung