DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
To: "Morten Brørup" <mb@smartsharesystems.com>,
	"Bruce Richardson" <bruce.richardson@intel.com>,
	dev@dpdk.org
Subject: Re: [PATCH v2 4/4] mempool perf test: test random bulk sizes
Date: Mon, 31 Mar 2025 17:48:42 +0300	[thread overview]
Message-ID: <3fd8b3ab-27e9-4972-850f-60466652e223@oktetlabs.ru> (raw)
In-Reply-To: <20250331100343.213430-5-mb@smartsharesystems.com>

On 3/31/25 13:03, Morten Brørup wrote:
> Bulk requests to get or put objects in a mempool often vary in size.
> A series of tests with pseudo random request sizes, to mitigate the
> benefits of the CPU's dynamic branch predictor, was added.
> 
> Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

[snip]

> @@ -181,9 +240,9 @@ per_lcore_mempool_test(void *arg)
>   	}
>   
>   	/* n_get_bulk and n_put_bulk must be divisors of n_keep */
> -	if (((n_keep / n_get_bulk) * n_get_bulk) != n_keep)
> +	if (!n_max_bulk && (((n_keep / n_get_bulk) * n_get_bulk) != n_keep))

IMHO n_max_bulk == 0 would be easier to read and as far as I remember
DPDK coding style recommends the same style.

>   		GOTO_ERR(ret, out);
> -	if (((n_keep / n_put_bulk) * n_put_bulk) != n_keep)
> +	if (!n_max_bulk && (((n_keep / n_put_bulk) * n_put_bulk) != n_keep))

same

>   		GOTO_ERR(ret, out);
>   	/* for constant n, n_get_bulk and n_put_bulk must be the same */
>   	if (use_constant_values && n_put_bulk != n_get_bulk)
> @@ -200,7 +259,9 @@ per_lcore_mempool_test(void *arg)
>   	start_cycles = rte_get_timer_cycles();
>   
>   	while (time_diff/hz < TIME_S) {
> -		if (!use_constant_values)
> +		if (n_max_bulk)

n_max_bulk != 0
as DPDK coding style says

> +			ret = test_loop_random(mp, cache, n_keep, n_max_bulk);
> +		else if (!use_constant_values)
>   			ret = test_loop(mp, cache, n_keep, n_get_bulk, n_put_bulk);
>   		else if (n_get_bulk == 1)
>   			ret = test_loop(mp, cache, n_keep, 1, 1);
> @@ -261,9 +322,13 @@ launch_cores(struct rte_mempool *mp, unsigned int cores)
>   	       use_external_cache ? external_cache_size : (unsigned int) mp->cache_size,
>   	       cores,
>   	       n_keep);
> -	printf("n_get_bulk=%3u n_put_bulk=%3u constant_n=%u ",
> -	       n_get_bulk, n_put_bulk,
> -	       use_constant_values);
> +	if (n_max_bulk)

same

> +		printf("n_max_bulk=%3u ",
> +		       n_max_bulk);
> +	else
> +		printf("n_get_bulk=%3u n_put_bulk=%3u constant_n=%u ",
> +		       n_get_bulk, n_put_bulk,
> +		       use_constant_values);
>   
>   	if (rte_mempool_avail_count(mp) != MEMPOOL_SIZE) {
>   		printf("mempool is not full\n");

[snip]

  reply	other threads:[~2025-03-31 14:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-28 16:48 [PATCH] " Morten Brørup
2025-03-13  8:23 ` Morten Brørup
2025-03-25  7:15   ` Morten Brørup
2025-03-30  8:29 ` Andrew Rybchenko
2025-03-30  8:57   ` Morten Brørup
2025-03-31 10:03 ` [PATCH v2 0/4] " Morten Brørup
2025-03-31 10:03   ` [PATCH v2 1/4] mempool perf test: replace bare unsigned with unsigned int Morten Brørup
2025-03-31 10:03   ` [PATCH v2 2/4] mempool perf test: test default mempool with cache Morten Brørup
2025-03-31 10:03   ` [PATCH v2 3/4] mempool perf test: improve output readability Morten Brørup
2025-03-31 10:03   ` [PATCH v2 4/4] mempool perf test: test random bulk sizes Morten Brørup
2025-03-31 14:48     ` Andrew Rybchenko [this message]
2025-04-02  9:07       ` Morten Brørup
2025-03-31 14:48   ` [PATCH v2 0/4] " Andrew Rybchenko
2025-04-01 15:00 ` Morten Brørup
2025-04-01 15:00   ` [PATCH v2 1/4] mempool perf test: replace bare unsigned with unsigned int Morten Brørup
2025-04-01 15:00   ` [PATCH v2 2/4] mempool perf test: test default mempool with cache Morten Brørup
2025-04-01 15:00   ` [PATCH v2 3/4] mempool perf test: improve output readability Morten Brørup
2025-04-01 15:00   ` [PATCH v2 4/4] mempool perf test: test random bulk sizes Morten Brørup
2025-04-01 15:02 ` [PATCH v3 0/4] " Morten Brørup
2025-04-01 15:02   ` [PATCH v3 1/4] mempool perf test: replace bare unsigned with unsigned int Morten Brørup
2025-04-01 15:02   ` [PATCH v3 2/4] mempool perf test: test default mempool with cache Morten Brørup
2025-04-01 15:02   ` [PATCH v3 3/4] mempool perf test: improve output readability Morten Brørup
2025-04-01 15:02   ` [PATCH v3 4/4] mempool perf test: test random bulk sizes Morten Brørup

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=3fd8b3ab-27e9-4972-850f-60466652e223@oktetlabs.ru \
    --to=andrew.rybchenko@oktetlabs.ru \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.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).