[PATCH v4] eal: allow worker lcore stacks to be allocated from hugepage memory

Don Wallwork donw at xsightlabs.com
Tue May 24 21:38:35 CEST 2022



On 5/24/2022 10:40 AM, Burakov, Anatoly wrote:
> On 17-May-22 4:31 PM, Don Wallwork wrote:
>> Add support for using hugepages for worker lcore stack memory.  The
>> intent is to improve performance by reducing stack memory related TLB
>> misses and also by using memory local to the NUMA node of each lcore.
>>
>> EAL option '--huge-worker-stack [stack-size-in-kbytes]' is added to 
>> allow
>> the feature to be enabled at runtime.  If the size is not specified,
>> the system pthread stack size will be used.
>>
>> Signed-off-by: Don Wallwork <donw at xsightlabs.com>
>> Acked-by: Morten Brørup <mb at smartsharesystems.com>
>> ---
>
> <snip>
>
>> +++ b/lib/eal/common/eal_common_options.c
>> @@ -103,6 +103,7 @@ eal_long_options[] = {
>>       {OPT_TELEMETRY,         0, NULL, OPT_TELEMETRY_NUM },
>>       {OPT_NO_TELEMETRY,      0, NULL, OPT_NO_TELEMETRY_NUM },
>>       {OPT_FORCE_MAX_SIMD_BITWIDTH, 1, NULL, 
>> OPT_FORCE_MAX_SIMD_BITWIDTH_NUM},
>> +    {OPT_HUGE_WORKER_STACK, 2, NULL, OPT_HUGE_WORKER_STACK_NUM     },
>>         {0,                     0, NULL, 0                        }
>>   };
>> @@ -1618,6 +1619,28 @@ eal_parse_huge_unlink(const char *arg, struct 
>> hugepage_file_discipline *out)
>>       return -1;
>>   }
>>   +#ifndef RTE_EXEC_ENV_WINDOWS
>
> Why the #ifdef-ery? This is common code, I think we can just leave it 
> there? You could just add a check for `huge_worker_stack_size` in 
> Windows EAL to guard against using this setting for Windows, but 
> otherwise I see no need for an #ifdef here.
>

Was trying to follow the convention used in other cases, but I will post 
a new version that eliminates the ifdefs and checks 
huge_worker_stack_size in FreeBSD and Windows EAL.


More information about the dev mailing list