DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test/table: skip when not enough memory is available
@ 2019-07-05  9:19 David Marchand
  2019-07-05 17:54 ` Dumitrescu, Cristian
  0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2019-07-05  9:19 UTC (permalink / raw)
  To: dev; +Cc: Cristian Dumitrescu

Following empirical tries, this test wants at least 3300M of memory to
run.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 app/test/test_table.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/app/test/test_table.c b/app/test/test_table.c
index a4b0ed6..dca1b33 100644
--- a/app/test/test_table.c
+++ b/app/test/test_table.c
@@ -134,6 +134,13 @@ uint32_t pipeline_test_hash_cuckoo(const void *key,
 {
 	int status, ret;
 	unsigned i;
+	void *p;
+
+	/* empirical value, please refine when updating this test */
+	p = rte_malloc("enough_memory_for_test", (size_t)3300 << 20, 0);
+	if (!p)
+		return TEST_SKIPPED;
+	rte_free(p);
 
 	ret = TEST_SUCCESS;
 
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] test/table: skip when not enough memory is available
  2019-07-05  9:19 [dpdk-dev] [PATCH] test/table: skip when not enough memory is available David Marchand
@ 2019-07-05 17:54 ` Dumitrescu, Cristian
  2019-07-05 20:47   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Dumitrescu, Cristian @ 2019-07-05 17:54 UTC (permalink / raw)
  To: David Marchand, dev

Hi David,

> -----Original Message-----
> From: David Marchand [mailto:david.marchand@redhat.com]
> Sent: Friday, July 5, 2019 10:19 AM
> To: dev@dpdk.org
> Cc: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Subject: [PATCH] test/table: skip when not enough memory is available
> 
> Following empirical tries, this test wants at least 3300M of memory to
> run.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  app/test/test_table.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/app/test/test_table.c b/app/test/test_table.c
> index a4b0ed6..dca1b33 100644
> --- a/app/test/test_table.c
> +++ b/app/test/test_table.c
> @@ -134,6 +134,13 @@ uint32_t pipeline_test_hash_cuckoo(const void
> *key,
>  {
>  	int status, ret;
>  	unsigned i;
> +	void *p;
> +
> +	/* empirical value, please refine when updating this test */
> +	p = rte_malloc("enough_memory_for_test", (size_t)3300 << 20, 0);
> +	if (!p)
> +		return TEST_SKIPPED;
> +	rte_free(p);
> 
>  	ret = TEST_SUCCESS;
> 
> --
> 1.8.3.1

Yes, some tests need large amounts of memory.

I understand your proposal, but it feels a bit like a hack for this test. Could we create a more generic fix?

Expanding on your idea, could we wrap this code into a macro such as TEST_CHECK_FOR_LARGE_MEMORY(memsize_in_gb) that could live in test.h and call it for this test (and potentially others that have the same requirements)?

Or maybe people have a better idea?

Thanks,
Cristian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] test/table: skip when not enough memory is available
  2019-07-05 17:54 ` Dumitrescu, Cristian
@ 2019-07-05 20:47   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2019-07-05 20:47 UTC (permalink / raw)
  To: Dumitrescu, Cristian; +Cc: dev, David Marchand

Hi,

05/07/2019 19:54, Dumitrescu, Cristian:
> From: David Marchand [mailto:david.marchand@redhat.com]
> > Following empirical tries, this test wants at least 3300M of memory to
> > run.
> > 
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> 
> Yes, some tests need large amounts of memory.

Basic tests should not.

> I understand your proposal, but it feels
> a bit like a hack for this test.

Of course it is a hack, probably on purpose to show the issue :)

> Could we create a more generic fix?
> 
> Expanding on your idea, could we wrap this code
> into a macro such as TEST_CHECK_FOR_LARGE_MEMORY(memsize_in_gb)
> that could live in test.h and call it for this test
> (and potentially others that have the same requirements)?

I don't see what it would improve.

> Or maybe people have a better idea?

Yes, a better idea is to reduce the requirements.
Requiring more than 3GB for a unit test is not reasonnable.
If you want to stress the algorithm, then it is a performance test,
and it won't be launched on basic CI.

So there are 2 proposals here:
	- use small memory amount
	- classify as perf test
Please choose one of these two, but neither the hack above,
nor a macro to hide the hack.
Thanks



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-05 20:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-05  9:19 [dpdk-dev] [PATCH] test/table: skip when not enough memory is available David Marchand
2019-07-05 17:54 ` Dumitrescu, Cristian
2019-07-05 20:47   ` Thomas Monjalon

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).