From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78BB7C43334 for ; Mon, 27 Jun 2022 17:47:41 +0000 (UTC) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0343440691; Mon, 27 Jun 2022 19:47:40 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id B0E6340685 for ; Mon, 27 Jun 2022 19:47:38 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 773311E86B for ; Mon, 27 Jun 2022 19:47:38 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 6688C1EB23; Mon, 27 Jun 2022 19:47:38 +0200 (CEST) Received: from [192.168.1.59] (unknown [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id B4CF11E5F0; Mon, 27 Jun 2022 19:47:37 +0200 (CEST) Message-ID: <0cfb2d19-ca59-fbba-c428-2e7629da43ec@lysator.liu.se> Date: Mon, 27 Jun 2022 19:47:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: Service core statistics MT safety Content-Language: en-US To: Honnappa Nagarahalli , =?UTF-8?Q?Morten_Br=c3=b8rup?= , =?UTF-8?Q?Mattias_R=c3=b6nnblom?= , "dev@dpdk.org" Cc: "harry.van.haaren@intel.com" , nd References: <336b6175-4fb9-92b9-f65d-b6917822d1bc@ericsson.com> <98CBD80474FA8B44BF855DF32C47DC35D87186@smartserver.smartshare.dk> From: =?UTF-8?Q?Mattias_R=c3=b6nnblom?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP 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 2022-06-27 19:39, Honnappa Nagarahalli wrote: > >> >>> From: Mattias Rönnblom [mailto:mattias.ronnblom@ericsson.com] >>> Sent: Monday, 27 June 2022 13.06 >>> >>> Hi. >>> >>> Is it safe to enable stats on MT safe services? >>> >>> https://github.com/DPDK/dpdk/blob/main/lib/eal/common/rte_service.c#L3 >>> 6 >>> 6 >>> >>> It seems to me this would have to be an __atomic_add for this code to >>> produce deterministic results. >> >> I agree. The same goes for the 'calls' field. > The calling function does the locking. https://github.com/DPDK/dpdk/blob/main/lib/eal/common/rte_service.c#L398 > > For more information you can look at: https://github.com/DPDK/dpdk/blob/main/lib/eal/include/rte_service.h#L120 > What about the https://github.com/DPDK/dpdk/blob/main/lib/eal/common/rte_service.c#L404 call (for MT safe services)? There's no lock held there.