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 38A8141CEC; Mon, 20 Feb 2023 14:43:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D3AEF43047; Mon, 20 Feb 2023 14:43:56 +0100 (CET) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id 769B140395 for ; Mon, 20 Feb 2023 14:43:55 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id EA56E3200D5B; Mon, 20 Feb 2023 08:43:53 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 20 Feb 2023 08:43:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1676900633; x= 1676987033; bh=4HSzKL/y0Ddr+rGPKf7pCxO0M6eihncirjTHqwhb1pM=; b=O MVcLlb9MpNNErGpIp5EuYAPUX/MRtPTwYWPl9NVbN4T2YN6nE7tqbdbPnOW2l2g2 3vqvjSeW36T3pBnWoEJytc1xJVjfhECJY/DqcJWjMZo7Wnkc+NDyoTgNcxCwb8EJ fJ/e5XTDxet1/oQ5IcHw/1N4de0xToNo9lX4fkwlKOoAvIB8BjszRo7P22lXqbMR I5ssUHr/vLDgb6UVVqM9bU/5MbaNvsFWwLPkpDwdRM/cDuZH5axEx+KW7szgtZ1n osfu2wn34B8xfprcQDSvEs8EN9j5XPmxfQiZJNZyOUNBIM88thaKSJONH1YOb16V u9QtBKvG3rURWxPurVISg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1676900633; x= 1676987033; bh=4HSzKL/y0Ddr+rGPKf7pCxO0M6eihncirjTHqwhb1pM=; b=F 2bHLFDw5Qah+D8OBpWqGMlZYCWr/yPtvKIEM67crGiGrrF+S/aJaFYGDdOUZ4olq 2wBFnYLI1rubPfglfg2lPDM5Eti7G3nQswl6MsDuGY/41PHorLeI6LZNPW93vPid 4zx1vw/ryfBsqAcPJ9ftybIDPoVOPDnNkwVYGJQwhzuOcthuQbReyXjGrhqV8S6w iBwsa6CFo3gipKJ00vEcs+Z3qzVNZDl9U7NnPl8Eliu9pN5kxBhQ29RR9V6xeZ5i MZKvMGeBlCaytAUyGFuXV8SFQm0u3Mj7VE8T3n9MdzNT3iTSZ5qKywfTqUabYiVL +ClS8WWmsiGL3Bq6aS/jg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudejhedggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthhqredttddtudenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpeefhfejleeuvdevtddutdeutdevhfeijeethfffueejhfetuddu vedtkedtieekffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 20 Feb 2023 08:43:52 -0500 (EST) From: Thomas Monjalon To: wushaohua@chinatelecom.cn, dev@dpdk.org Cc: olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru, Morten =?ISO-8859-1?Q?Br=F8rup?= Subject: Re: [PATCH] mempool:Add monitor dump for memory pool Date: Mon, 20 Feb 2023 14:43:50 +0100 Message-ID: <4752350.JsnAkG3lO3@thomas> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D87616@smartserver.smartshare.dk> References: <20230101051803.1363757-1-wushaohua@chinatelecom.cn> <98CBD80474FA8B44BF855DF32C47DC35D87616@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" 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 01/01/2023 12:28, Morten Br=F8rup: > > From: wushaohua@chinatelecom.cn [mailto:wushaohua@chinatelecom.cn] > > Sent: Sunday, 1 January 2023 06.18 > >=20 > > From: Shaohua Wu > >=20 > > rte_mempool_dump add dump for monitoring available and > > used memory blocks > >=20 > > Signed-off-by: Shaohua Wu > > --- > > lib/mempool/rte_mempool.c | 5 +++++ > > 1 file changed, 5 insertions(+) > >=20 > > diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c > > index f33f455790..09d512a604 100644 > > --- a/lib/mempool/rte_mempool.c > > +++ b/lib/mempool/rte_mempool.c > > @@ -1265,9 +1265,14 @@ rte_mempool_dump(FILE *f, struct rte_mempool > > *mp) > >=20 > > cache_count =3D rte_mempool_dump_cache(f, mp); > > common_count =3D rte_mempool_ops_get_count(mp); > > + > > if ((cache_count + common_count) > mp->size) > > common_count =3D mp->size - cache_count; > > fprintf(f, " common_pool_count=3D%u\n", common_count); > > + fprintf(f, " common_pool_avail_count=3D%u\n", > > + rte_mempool_avail_count(mp)); >=20 > The number of available objects in the common pool is already shown as "c= ommon_pool_count". >=20 > If you want to show the total number of available objects in both the com= mon pool and the caches, you can calculate is as common_count + cache_count= , instead of calling rte_mempool_avail_count(). And "total_count" would be = a better name than "common_pool_avail_count". >=20 > > + fprintf(f, " common_pool_used_count=3D%u\n", > > + rte_mempool_in_use_count(mp)); >=20 > common_pool_used_count can be calculated as mp->size - common_count, inst= ead of calling rte_mempool_in_use_count(mp). No reply... I assume it is a rejected patch.