From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A3783A0555; Fri, 26 Aug 2022 10:16:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B33E40146; Fri, 26 Aug 2022 10:16:29 +0200 (CEST) Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) by mails.dpdk.org (Postfix) with ESMTP id 2FD1D40143 for ; Fri, 26 Aug 2022 10:16:28 +0200 (CEST) Received: by mail-qt1-f174.google.com with SMTP id cr9so701994qtb.13 for ; Fri, 26 Aug 2022 01:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=+Ru5J252U3BVJjXl8VuK5X53WkSQX9BKl/GIqajkFVo=; b=cvpC+lDsETu12uMz9GL+iPDQtRtjjI/fCgZnq34R6QCdCc7EUhWsZQDrMT381NeD3t xH2jEu8XI4lrX5M1KsO/WFnAmkd3vH8FVj9rVRmbDg8meaSeFqboCXAmuKACuYIjvQ7e 9y6sfe6S9M68UEX5HYln68xxxLv6nc0upwDKKUBppqELRDyUyX0Kj6TOoeOdgtFFOBU6 8otboulyL/5ZqvFcmp5Nbt1gP/k6XGCgEIz1Yp4yE636tbxUsvNnPNufMGb9i0X6tPZj gj/gA2WjXUlr+YsW0Bb2OKXdKmQrQ0mMJvCCYcTUi55XXFOge9wlPA2TU5Tdg2k/dOyu +zVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=+Ru5J252U3BVJjXl8VuK5X53WkSQX9BKl/GIqajkFVo=; b=S38tbPKCctPq4++bGkii0FYloXeMCOzX9loTBOLuBU9/e41ZXRUOhi4URCJ/1ENsCQ ar/2Vb1XXjgKXCX8ZL6OspsEJDqU8GqhYTJ6DjgwrKAK3spicC+c+dgHPpFA32kIsSCJ rFfyUnIkLD6/OqucO4KM6UuY9uKt8fBzGLIOpDw6Yx8dO2371sP321x7fP4g0X/w2CBF lHRytxat90eZ3JGTTvHdtffLwU/LwOalZIMv1buuw7HJRFF51KsjOZs+1wd2NG616wOZ VNpj8KXmsNPwA4BIbg6yrSn1+wQtifR7VbbXdwt3o3zfHQ1Uny3VR4iekT+4dFwuadlA mWhg== X-Gm-Message-State: ACgBeo2gDt3OCBgCt3ci1vgL3r4jOUEXa4SdARR3FYDYcx9pqXBx/YUT 0rn/LlVl3vEd7IsW27Pu5eN2jj7yJrzzfU7tBv0= X-Google-Smtp-Source: AA6agR5nd1+glGRaMtxgx0HhIrSeYCq3oc1ILvRlP+g8+BOusi5KfC72NZmORuHOSLudo0JRpTTuZfJjFpMRJfJyInw= X-Received: by 2002:ac8:4e92:0:b0:342:fb5b:5864 with SMTP id 18-20020ac84e92000000b00342fb5b5864mr6891587qtp.410.1661501787498; Fri, 26 Aug 2022 01:16:27 -0700 (PDT) MIME-Version: 1.0 References: <24c49429394294cfbf0d9c506b205029bac77c8b.1657890378.git.anatoly.burakov@intel.com> <20220825152852.1231849-1-kevin.laatz@intel.com> <20220825152852.1231849-2-kevin.laatz@intel.com> In-Reply-To: From: Jerin Jacob Date: Fri, 26 Aug 2022 13:46:01 +0530 Message-ID: Subject: Re: [PATCH v3 1/3] eal: add lcore poll busyness telemetry To: Bruce Richardson Cc: Kevin Laatz , dpdk-dev , Anatoly Burakov , Conor Walsh , David Hunt , Nicolas Chautru , Fan Zhang , Ashish Gupta , Akhil Goyal , Chengwen Feng , Ray Kinsella , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Jerin Jacob , Sachin Saxena , Hemant Agrawal , Ori Kam , Honnappa Nagarahalli , Konstantin Ananyev , =?UTF-8?Q?Morten_Br=C3=B8rup?= Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, Aug 26, 2022 at 1:37 PM Bruce Richardson wrote: > > On Fri, Aug 26, 2022 at 12:35:16PM +0530, Jerin Jacob wrote: > > On Thu, Aug 25, 2022 at 8:56 PM Kevin Laatz wrote: > > > > > > From: Anatoly Burakov > > > > > > Currently, there is no way to measure lcore poll busyness in a passive way, > > > without any modifications to the application. This patch adds a new EAL API > > > that will be able to passively track core polling busyness. > > > > > > The poll busyness is calculated by relying on the fact that most DPDK API's > > > will poll for packets. Empty polls can be counted as "idle", while > > > non-empty polls can be counted as busy. To measure lcore poll busyness, we > > > simply call the telemetry timestamping function with the number of polls a > > > particular code section has processed, and count the number of cycles we've > > > spent processing empty bursts. The more empty bursts we encounter, the less > > > cycles we spend in "busy" state, and the less core poll busyness will be > > > reported. > > > > > > In order for all of the above to work without modifications to the > > > application, the library code needs to be instrumented with calls to the > > > lcore telemetry busyness timestamping function. The following parts of DPDK > > > are instrumented with lcore telemetry calls: > > > > > > - All major driver API's: > > > - ethdev > > > - cryptodev > > > - compressdev > > > - regexdev > > > - bbdev > > > - rawdev > > > - eventdev > > > - dmadev > > > - Some additional libraries: > > > - ring > > > - distributor > > > > > > To avoid performance impact from having lcore telemetry support, a global > > > variable is exported by EAL, and a call to timestamping function is wrapped > > > into a macro, so that whenever telemetry is disabled, it only takes one > > > additional branch and no function calls are performed. It is also possible > > > to disable it at compile time by commenting out RTE_LCORE_BUSYNESS from > > > build config. > > > > > > This patch also adds a telemetry endpoint to report lcore poll busyness, as > > > well as telemetry endpoints to enable/disable lcore telemetry. A > > > documentation entry has been added to the howto guides to explain the usage > > > of the new telemetry endpoints and API. > > > > > > Signed-off-by: Kevin Laatz > > > Signed-off-by: Conor Walsh > > > Signed-off-by: David Hunt > > > Signed-off-by: Anatoly Burakov > > > > > > --- > > > v3: > > > * Fix missed renaming to poll busyness > > > * Fix clang compilation > > > * Fix arm compilation > > > > > > v2: > > > * Use rte_get_tsc_hz() to adjust the telemetry period > > > * Rename to reflect polling busyness vs general busyness > > > * Fix segfault when calling telemetry timestamp from an unregistered > > > non-EAL thread. > > > * Minor cleanup > > > --- > > > > > diff --git a/meson_options.txt b/meson_options.txt > > > index 7c220ad68d..725b851f69 100644 > > > --- a/meson_options.txt > > > +++ b/meson_options.txt > > > @@ -20,6 +20,8 @@ option('enable_driver_sdk', type: 'boolean', value: false, description: > > > 'Install headers to build drivers.') > > > option('enable_kmods', type: 'boolean', value: false, description: > > > 'build kernel modules') > > > +option('enable_lcore_poll_busyness', type: 'boolean', value: true, description: > > > + 'enable collection of lcore poll busyness telemetry') > > > > IMO, All fastpath features should be opt-in. i.e default should be false. > > For the trace fastpath related changes, We have done the similar thing > > even though it cost additional one cycle for disabled trace points > > > > We do need to consider runtime and build defaults differently, though. > Since this has also runtime enabling, I think having build-time enabling > true as default is ok, so long as the runtime enabling is false (assuming > no noticable overhead when the feature is disabled.) I was talking about buildtime only. "enable_trace_fp" meson option selected as false as default. If the concern is enabling on generic distros then distro generic config can opt in this > > /Bruce