DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Yunjian Wang <wangyunjian@huawei.com>, <dev@dpdk.org>
Cc: <xiaoyun.li@intel.com>, <aman.deep.singh@intel.com>,
	<xuemingl@nvidia.com>, <dingxiaoxiong@huawei.com>,
	<xudingke@huawei.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: log the largest free block when dumping socket memory
Date: Tue, 18 Jan 2022 16:17:09 +0000	[thread overview]
Message-ID: <dccd64ef-3953-3bc2-d6d9-00b1d1ee3f03@intel.com> (raw)
In-Reply-To: <da0dc3b3ba2695d1ff1798fc6c921da6079f00d3.1640585898.git.wangyunjian@huawei.com>

On 12/27/2021 10:49 AM, Yunjian Wang wrote:
> Add log print of the largest free block in dump_socket_mem.

1) What do you mean with "largest free block", is largest continuous block?
    If so is this physically continuous, or vfio continious?

2) Why this value is good for? Why we want to display it?

> It is useful to also log when dumping socket memory.
> 
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
>   app/test-pmd/cmdline.c | 10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index 6e10afeedd..d7bddf065a 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -9825,6 +9825,7 @@ dump_socket_mem(FILE *f)
>   	size_t total = 0;
>   	size_t alloc = 0;
>   	size_t free = 0;
> +	size_t greatest_free_size = 0;
>   	unsigned int n_alloc = 0;
>   	unsigned int n_free = 0;
>   	static size_t last_allocs;
> @@ -9840,22 +9841,27 @@ dump_socket_mem(FILE *f)
>   		free += socket_stats.heap_freesz_bytes;
>   		n_alloc += socket_stats.alloc_count;
>   		n_free += socket_stats.free_count;
> +		greatest_free_size = RTE_MAX(greatest_free_size, socket_stats.greatest_free_size);
>   		fprintf(f,
> -			"Socket %u: size(M) total: %.6lf alloc: %.6lf(%.3lf%%) free: %.6lf \tcount alloc: %-4u free: %u\n",
> +			"Socket %u: size(M) total: %.6lf alloc: %.6lf(%.3lf%%) free: %.6lf max: %.6lf \t"
> +			"count alloc: %-4u free: %u\n",

'max' is not clear what that value is, can you please update it?

>   			i,
>   			(double)socket_stats.heap_totalsz_bytes / (1024 * 1024),
>   			(double)socket_stats.heap_allocsz_bytes / (1024 * 1024),
>   			(double)socket_stats.heap_allocsz_bytes * 100 /
>   			(double)socket_stats.heap_totalsz_bytes,
>   			(double)socket_stats.heap_freesz_bytes / (1024 * 1024),
> +			(double)socket_stats.greatest_free_size / (1024 * 1024),
>   			socket_stats.alloc_count,
>   			socket_stats.free_count);
>   	}
>   	fprintf(f,
> -		"Total   : size(M) total: %.6lf alloc: %.6lf(%.3lf%%) free: %.6lf \tcount alloc: %-4u free: %u\n",
> +		"Total   : size(M) total: %.6lf alloc: %.6lf(%.3lf%%) free: %.6lf max: %.6lf \t"
> +		"count alloc: %-4u free: %u\n",
>   		(double)total / (1024 * 1024), (double)alloc / (1024 * 1024),
>   		total ? ((double)alloc * 100 / (double)total) : 0,
>   		(double)free / (1024 * 1024),
> +		(double)greatest_free_size / (1024 * 1024),

This is not displaying the total value, but last value. Need to gather values in loop
to be able to display the total value.

>   		n_alloc, n_free);
>   	if (last_allocs)
>   		fprintf(stdout, "Memory total change: %.6lf(M), allocation change: %.6lf(M)\n",


      reply	other threads:[~2022-01-18 16:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-27 10:49 Yunjian Wang
2022-01-18 16:17 ` Ferruh Yigit [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dccd64ef-3953-3bc2-d6d9-00b1d1ee3f03@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=aman.deep.singh@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=dingxiaoxiong@huawei.com \
    --cc=wangyunjian@huawei.com \
    --cc=xiaoyun.li@intel.com \
    --cc=xudingke@huawei.com \
    --cc=xuemingl@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).