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 AE277A0551; Fri, 26 Aug 2022 09:05:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C8DC40146; Fri, 26 Aug 2022 09:05:45 +0200 (CEST) Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) by mails.dpdk.org (Postfix) with ESMTP id B435D40143 for ; Fri, 26 Aug 2022 09:05:42 +0200 (CEST) Received: by mail-qv1-f50.google.com with SMTP id u6so448643qvp.5 for ; Fri, 26 Aug 2022 00:05:42 -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=YHDY2yHU1mD3lMmx5ce+zezPByEpmCMB7BRFuROoiSQ=; b=BOJRXR6M4H6/D7hcoAkx1Wsbeii1YLxjw1gdx8SkMQNgQ24DIzLFTq+uPKcjCsstcH aRN00NOnvR7QBXu80xMQvCUbLisJcggV+vtuw+wo5u/qdzcyteLk9j4W2coX/cF7fwlh FMjV1Vis880YKNEHDgXhtodnlXmuan4vj1rkowrPce4ZG7XmNR6Wa8Oyb3oRTI16TO9W DwN7UW7zGpK+CGe+06s/TpMwS/h2rj9+RwJz/PcVs3vqQEgX3hRjVoKlb845wbJDnFTT 64uCGqiRQ0vYrSWeMGkcWloBu5YW6sd/8GSV73VjO4LygHTKQEUcHK1UdXu0eOilF2cZ vANA== 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=YHDY2yHU1mD3lMmx5ce+zezPByEpmCMB7BRFuROoiSQ=; b=nboZI9ATe4qcB5flAEK8ng4s3oGZR/f6aTOMu4JeADLEW7JFMAksHsnv2OUFvwWCjU +uYMPz6KzpcrpU/VoOrbSG7ePW1PuWLlsmmeLojf7LvB/8mpkEq4SGjxZ2O8YeEpZ2M9 /VsYIr75BTElCe4xcuPbMVBvdbwMor8h/P7urLymLhODlx1DBXkzqe8eYH08c0snAHJ8 Ai6KHwZErnKpY8TrmZN5D5GscIwxLYWe/ptXeCeoNuWkdyJcCHYpSYAYQZyUgwEREnco VS2J34Ve1Siafx0e+6D9u1kj9dMnZ53K2VkN6c8FfSz8lFXBRG9j0Cwm8Jc0uqS8tvqi rx0g== X-Gm-Message-State: ACgBeo2qNFPPgEH9tkbDcBgc/xRRu/WOmKfR6qRWef5W58dWQuwF7arq 8DFYnmKJCbeneyMFR6nYnuKZxQezIFsxT0l/8R4= X-Google-Smtp-Source: AA6agR7nMOmKh/3b3E6qDR7TgG41BCGcPJIgSav3iOh4NtpRvad6VIe7KUl1InIXF6RTfzad4E7jXl8rZi4bHvQrhVY= X-Received: by 2002:a0c:b3cc:0:b0:487:4ff7:407d with SMTP id b12-20020a0cb3cc000000b004874ff7407dmr6746367qvf.95.1661497542313; Fri, 26 Aug 2022 00:05:42 -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: <20220825152852.1231849-2-kevin.laatz@intel.com> From: Jerin Jacob Date: Fri, 26 Aug 2022 12:35:16 +0530 Message-ID: Subject: Re: [PATCH v3 1/3] eal: add lcore poll busyness telemetry To: Kevin Laatz Cc: dpdk-dev , Anatoly Burakov , Conor Walsh , David Hunt , Bruce Richardson , 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 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 > option('examples', type: 'string', value: '', description: > 'Comma-separated list of examples to build by default') > option('flexran_sdk', type: 'string', value: '', description: > -- > 2.31.1 >