DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: warn on --no-huge allocation requirement
@ 2019-07-18  9:34 Thomas Monjalon
  2019-07-18 10:18 ` Burakov, Anatoly
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Thomas Monjalon @ 2019-07-18  9:34 UTC (permalink / raw)
  To: anatoly.burakov; +Cc: dev

When using --no-huge mode, dynamic allocation is not supported.
Because of this limitation, the option --legacy-mem is implied
and -m may be needed to specify the amount of memory to allocate.
Otherwise the default amount MEMSIZE_IF_NO_HUGE_PAGE will be allocated.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/librte_eal/common/eal_common_options.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index 512d5088e..4a76929ea 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -1551,6 +1551,10 @@ eal_check_common_options(struct internal_config *internal_cfg)
 			"be specified at the same time\n");
 		return -1;
 	}
+	if (internal_cfg->no_hugetlbfs && internal_cfg->memory == 0) {
+		RTE_LOG(NOTICE, EAL, "Option --"OPT_NO_HUGE" uses legacy mode, "
+			"option -m would override default memory allocation\n");
+	}
 	if (internal_cfg->no_hugetlbfs && internal_cfg->force_sockets == 1) {
 		RTE_LOG(ERR, EAL, "Option --"OPT_SOCKET_MEM" cannot "
 			"be specified together with --"OPT_NO_HUGE"\n");
-- 
2.21.0


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

* Re: [dpdk-dev] [PATCH] eal: warn on --no-huge allocation requirement
  2019-07-18  9:34 [dpdk-dev] [PATCH] eal: warn on --no-huge allocation requirement Thomas Monjalon
@ 2019-07-18 10:18 ` Burakov, Anatoly
  2019-07-18 10:29   ` Thomas Monjalon
  2019-07-22 16:55 ` [dpdk-dev] [PATCH v2] eal: warn on legacy memory " Thomas Monjalon
  2019-07-30 17:21 ` [dpdk-dev] [PATCH v3] " Thomas Monjalon
  2 siblings, 1 reply; 10+ messages in thread
From: Burakov, Anatoly @ 2019-07-18 10:18 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On 18-Jul-19 10:34 AM, Thomas Monjalon wrote:
> When using --no-huge mode, dynamic allocation is not supported.
> Because of this limitation, the option --legacy-mem is implied
> and -m may be needed to specify the amount of memory to allocate.
> Otherwise the default amount MEMSIZE_IF_NO_HUGE_PAGE will be allocated.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>   lib/librte_eal/common/eal_common_options.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
> index 512d5088e..4a76929ea 100644
> --- a/lib/librte_eal/common/eal_common_options.c
> +++ b/lib/librte_eal/common/eal_common_options.c
> @@ -1551,6 +1551,10 @@ eal_check_common_options(struct internal_config *internal_cfg)
>   			"be specified at the same time\n");
>   		return -1;
>   	}
> +	if (internal_cfg->no_hugetlbfs && internal_cfg->memory == 0) {
> +		RTE_LOG(NOTICE, EAL, "Option --"OPT_NO_HUGE" uses legacy mode, "
> +			"option -m would override default memory allocation\n");

I think this is too technical and misleading. I don't think user cares 
about legacy vs dynamic mode here. I would rather print out something 
more informative, like, say, something along those lines:

"Option --no-huge was specified in command-line arguments. This mode 
uses static memory layout and will allocate %dMB of memory by default. 
Option '-m' can be used to increase allocated memory amount."

where %d is the amount of memory we're preallocating.

> +	}
>   	if (internal_cfg->no_hugetlbfs && internal_cfg->force_sockets == 1) {
>   		RTE_LOG(ERR, EAL, "Option --"OPT_SOCKET_MEM" cannot "
>   			"be specified together with --"OPT_NO_HUGE"\n");
> 


-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH] eal: warn on --no-huge allocation requirement
  2019-07-18 10:18 ` Burakov, Anatoly
@ 2019-07-18 10:29   ` Thomas Monjalon
  2019-07-18 10:37     ` Burakov, Anatoly
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2019-07-18 10:29 UTC (permalink / raw)
  To: Burakov, Anatoly; +Cc: dev

18/07/2019 12:18, Burakov, Anatoly:
> On 18-Jul-19 10:34 AM, Thomas Monjalon wrote:
> > When using --no-huge mode, dynamic allocation is not supported.
> > Because of this limitation, the option --legacy-mem is implied
> > and -m may be needed to specify the amount of memory to allocate.
> > Otherwise the default amount MEMSIZE_IF_NO_HUGE_PAGE will be allocated.
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > ---
> >   lib/librte_eal/common/eal_common_options.c | 4 ++++
> >   1 file changed, 4 insertions(+)
> > 
> > diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
> > index 512d5088e..4a76929ea 100644
> > --- a/lib/librte_eal/common/eal_common_options.c
> > +++ b/lib/librte_eal/common/eal_common_options.c
> > @@ -1551,6 +1551,10 @@ eal_check_common_options(struct internal_config *internal_cfg)
> >   			"be specified at the same time\n");
> >   		return -1;
> >   	}
> > +	if (internal_cfg->no_hugetlbfs && internal_cfg->memory == 0) {
> > +		RTE_LOG(NOTICE, EAL, "Option --"OPT_NO_HUGE" uses legacy mode, "
> > +			"option -m would override default memory allocation\n");
> 
> I think this is too technical and misleading. I don't think user cares 
> about legacy vs dynamic mode here. I would rather print out something 
> more informative, like, say, something along those lines:
> 
> "Option --no-huge was specified in command-line arguments. This mode 
> uses static memory layout and will allocate %dMB of memory by default. 
> Option '-m' can be used to increase allocated memory amount."
> 
> where %d is the amount of memory we're preallocating.

%d is defined in eal.c
It requires to move the value in a common .h

I may try something like you suggest in shorter.
A log is supposed to be short :)



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

* Re: [dpdk-dev] [PATCH] eal: warn on --no-huge allocation requirement
  2019-07-18 10:29   ` Thomas Monjalon
@ 2019-07-18 10:37     ` Burakov, Anatoly
  0 siblings, 0 replies; 10+ messages in thread
From: Burakov, Anatoly @ 2019-07-18 10:37 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On 18-Jul-19 11:29 AM, Thomas Monjalon wrote:
> 18/07/2019 12:18, Burakov, Anatoly:
>> On 18-Jul-19 10:34 AM, Thomas Monjalon wrote:
>>> When using --no-huge mode, dynamic allocation is not supported.
>>> Because of this limitation, the option --legacy-mem is implied
>>> and -m may be needed to specify the amount of memory to allocate.
>>> Otherwise the default amount MEMSIZE_IF_NO_HUGE_PAGE will be allocated.
>>>
>>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>>> ---
>>>    lib/librte_eal/common/eal_common_options.c | 4 ++++
>>>    1 file changed, 4 insertions(+)
>>>
>>> diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
>>> index 512d5088e..4a76929ea 100644
>>> --- a/lib/librte_eal/common/eal_common_options.c
>>> +++ b/lib/librte_eal/common/eal_common_options.c
>>> @@ -1551,6 +1551,10 @@ eal_check_common_options(struct internal_config *internal_cfg)
>>>    			"be specified at the same time\n");
>>>    		return -1;
>>>    	}
>>> +	if (internal_cfg->no_hugetlbfs && internal_cfg->memory == 0) {
>>> +		RTE_LOG(NOTICE, EAL, "Option --"OPT_NO_HUGE" uses legacy mode, "
>>> +			"option -m would override default memory allocation\n");
>>
>> I think this is too technical and misleading. I don't think user cares
>> about legacy vs dynamic mode here. I would rather print out something
>> more informative, like, say, something along those lines:
>>
>> "Option --no-huge was specified in command-line arguments. This mode
>> uses static memory layout and will allocate %dMB of memory by default.
>> Option '-m' can be used to increase allocated memory amount."
>>
>> where %d is the amount of memory we're preallocating.
> 
> %d is defined in eal.c
> It requires to move the value in a common .h
> 
> I may try something like you suggest in shorter.
> A log is supposed to be short :)
> 

OK, maybe not print the value and make it shorter, but definitely don't 
confuse the user with talk about legacy modes :)

-- 
Thanks,
Anatoly

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

* [dpdk-dev] [PATCH v2] eal: warn on legacy memory allocation requirement
  2019-07-18  9:34 [dpdk-dev] [PATCH] eal: warn on --no-huge allocation requirement Thomas Monjalon
  2019-07-18 10:18 ` Burakov, Anatoly
@ 2019-07-22 16:55 ` Thomas Monjalon
  2019-07-22 17:03   ` Thomas Monjalon
  2019-07-30 17:21 ` [dpdk-dev] [PATCH v3] " Thomas Monjalon
  2 siblings, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2019-07-22 16:55 UTC (permalink / raw)
  To: anatoly.burakov; +Cc: dev

When using --no-huge mode, dynamic allocation is not supported.
Because of this limitation, the option --legacy-mem is implied
and -m may be needed to specify the amount of memory to allocate.
Otherwise the default amount MEMSIZE_IF_NO_HUGE_PAGE will be allocated.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
v2:
	- user-oriented message
	- trigger warning on any legacy mem option
---
 lib/librte_eal/common/eal_common_options.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index 24e36cf23..5e489041a 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -1592,6 +1592,10 @@ eal_check_common_options(struct internal_config *internal_cfg)
 				"with --"OPT_MATCH_ALLOCATIONS"\n");
 		return -1;
 	}
+	if (internal_cfg->legacy_mem && internal_cfg->memory == 0) {
+		RTE_LOG(NOTICE, EAL, "Selected memory layout is static, "
+			"allocation can be increased with the option -m\n");
+	}
 
 	return 0;
 }
-- 
2.21.0


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

* Re: [dpdk-dev] [PATCH v2] eal: warn on legacy memory allocation requirement
  2019-07-22 16:55 ` [dpdk-dev] [PATCH v2] eal: warn on legacy memory " Thomas Monjalon
@ 2019-07-22 17:03   ` Thomas Monjalon
  2019-07-23  9:10     ` Burakov, Anatoly
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2019-07-22 17:03 UTC (permalink / raw)
  To: anatoly.burakov; +Cc: dev

22/07/2019 18:55, Thomas Monjalon:
> When using --no-huge mode, dynamic allocation is not supported.
> Because of this limitation, the option --legacy-mem is implied
> and -m may be needed to specify the amount of memory to allocate.
> Otherwise the default amount MEMSIZE_IF_NO_HUGE_PAGE will be allocated.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> v2:
> 	- user-oriented message
> 	- trigger warning on any legacy mem option
> ---
> --- a/lib/librte_eal/common/eal_common_options.c
> +++ b/lib/librte_eal/common/eal_common_options.c
> +	if (internal_cfg->legacy_mem && internal_cfg->memory == 0) {
> +		RTE_LOG(NOTICE, EAL, "Selected memory layout is static, "
> +			"allocation can be increased with the option -m\n");

Or better:

"Static memory layout is selected, "
"allocation can be increased with the option -m\n"




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

* Re: [dpdk-dev] [PATCH v2] eal: warn on legacy memory allocation requirement
  2019-07-22 17:03   ` Thomas Monjalon
@ 2019-07-23  9:10     ` Burakov, Anatoly
  0 siblings, 0 replies; 10+ messages in thread
From: Burakov, Anatoly @ 2019-07-23  9:10 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On 22-Jul-19 6:03 PM, Thomas Monjalon wrote:
> 22/07/2019 18:55, Thomas Monjalon:
>> When using --no-huge mode, dynamic allocation is not supported.
>> Because of this limitation, the option --legacy-mem is implied
>> and -m may be needed to specify the amount of memory to allocate.
>> Otherwise the default amount MEMSIZE_IF_NO_HUGE_PAGE will be allocated.
>>
>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>> ---
>> v2:
>> 	- user-oriented message
>> 	- trigger warning on any legacy mem option
>> ---
>> --- a/lib/librte_eal/common/eal_common_options.c
>> +++ b/lib/librte_eal/common/eal_common_options.c
>> +	if (internal_cfg->legacy_mem && internal_cfg->memory == 0) {
>> +		RTE_LOG(NOTICE, EAL, "Selected memory layout is static, "
>> +			"allocation can be increased with the option -m\n");
> 
> Or better:
> 
> "Static memory layout is selected,"
> "allocation can be increased with the option -m\n"
> 


Allocation of what? :) Without context, the message makes little sense. 
How about:

"Selected memory layout is static, amount of reserved memory can be 
adjusted with the option -m or --socket-mem".

The slight issue there is, --socket-mem works with legacy mem, but not 
with no-huge. However, i think --socket-mem will produce its own error 
on attempt to use it with --no-huge, so i don't think it's a big deal.

-- 
Thanks,
Anatoly

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

* [dpdk-dev] [PATCH v3] eal: warn on legacy memory allocation requirement
  2019-07-18  9:34 [dpdk-dev] [PATCH] eal: warn on --no-huge allocation requirement Thomas Monjalon
  2019-07-18 10:18 ` Burakov, Anatoly
  2019-07-22 16:55 ` [dpdk-dev] [PATCH v2] eal: warn on legacy memory " Thomas Monjalon
@ 2019-07-30 17:21 ` Thomas Monjalon
  2019-07-31  9:15   ` Burakov, Anatoly
  2 siblings, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2019-07-30 17:21 UTC (permalink / raw)
  To: anatoly.burakov; +Cc: dev

When using --no-huge mode, dynamic allocation is not supported.
Because of this limitation, the option --legacy-mem is implied
and -m may be needed to specify the amount of memory to allocate.
Otherwise the default amount MEMSIZE_IF_NO_HUGE_PAGE will be allocated.

The option --socket-mem can also be used with --legacy-mem
when hugepages are supported.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
v3:
	- replace "allocation" with "amount of reserved memory"
	- add --socket-mem
	- more rewording
v2:
	- user-oriented message
	- trigger warning on any legacy mem option
---
 lib/librte_eal/common/eal_common_options.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index 512d5088e..ab0b6082b 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -1589,6 +1589,11 @@ eal_check_common_options(struct internal_config *internal_cfg)
 				"with --"OPT_MATCH_ALLOCATIONS"\n");
 		return -1;
 	}
+	if (internal_cfg->legacy_mem && internal_cfg->memory == 0) {
+		RTE_LOG(NOTICE, EAL, "Static memory layout is selected, "
+			"amount of reserved memory can be adjusted with "
+			"-m or --"OPT_SOCKET_MEM"\n");
+	}
 
 	return 0;
 }
-- 
2.21.0


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

* Re: [dpdk-dev] [PATCH v3] eal: warn on legacy memory allocation requirement
  2019-07-30 17:21 ` [dpdk-dev] [PATCH v3] " Thomas Monjalon
@ 2019-07-31  9:15   ` Burakov, Anatoly
  2019-08-05  9:46     ` Thomas Monjalon
  0 siblings, 1 reply; 10+ messages in thread
From: Burakov, Anatoly @ 2019-07-31  9:15 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On 30-Jul-19 6:21 PM, Thomas Monjalon wrote:
> When using --no-huge mode, dynamic allocation is not supported.
> Because of this limitation, the option --legacy-mem is implied
> and -m may be needed to specify the amount of memory to allocate.
> Otherwise the default amount MEMSIZE_IF_NO_HUGE_PAGE will be allocated.
> 
> The option --socket-mem can also be used with --legacy-mem
> when hugepages are supported.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> v3:
> 	- replace "allocation" with "amount of reserved memory"
> 	- add --socket-mem
> 	- more rewording
> v2:
> 	- user-oriented message
> 	- trigger warning on any legacy mem option
> ---

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH v3] eal: warn on legacy memory allocation requirement
  2019-07-31  9:15   ` Burakov, Anatoly
@ 2019-08-05  9:46     ` Thomas Monjalon
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2019-08-05  9:46 UTC (permalink / raw)
  To: dev; +Cc: Burakov, Anatoly

31/07/2019 11:15, Burakov, Anatoly:
> On 30-Jul-19 6:21 PM, Thomas Monjalon wrote:
> > When using --no-huge mode, dynamic allocation is not supported.
> > Because of this limitation, the option --legacy-mem is implied
> > and -m may be needed to specify the amount of memory to allocate.
> > Otherwise the default amount MEMSIZE_IF_NO_HUGE_PAGE will be allocated.
> > 
> > The option --socket-mem can also be used with --legacy-mem
> > when hugepages are supported.
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied




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

end of thread, other threads:[~2019-08-05  9:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-18  9:34 [dpdk-dev] [PATCH] eal: warn on --no-huge allocation requirement Thomas Monjalon
2019-07-18 10:18 ` Burakov, Anatoly
2019-07-18 10:29   ` Thomas Monjalon
2019-07-18 10:37     ` Burakov, Anatoly
2019-07-22 16:55 ` [dpdk-dev] [PATCH v2] eal: warn on legacy memory " Thomas Monjalon
2019-07-22 17:03   ` Thomas Monjalon
2019-07-23  9:10     ` Burakov, Anatoly
2019-07-30 17:21 ` [dpdk-dev] [PATCH v3] " Thomas Monjalon
2019-07-31  9:15   ` Burakov, Anatoly
2019-08-05  9:46     ` 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).