[dpdk-dev] [PATCH v4 8/8] eal/windows: implement basic memory management

Burakov, Anatoly anatoly.burakov at intel.com
Wed May 6 11:46:59 CEST 2020


On 06-May-20 12:20 AM, Dmitry Kozlyuk wrote:
> On 2020-05-05 17:24 GMT+0100 Burakov, Anatoly wrote:
>> On 29-Apr-20 12:50 AM, Dmitry Kozlyuk wrote:
>> Lots of duplication... I wonder if it would be possible to share at
>> least some of this code in common. Tracking down bugs because of
>> duplicated code desync is always a pain...
> 
> This was the main question of the cover letter :)
> Dmitry Malloy explained to me recently that even internally Windows has
> no notion of preallocated hugepages and "memory types" (as memseg_primary_init
> describes it). Since Windows EAL is not going to support multi-process any
> time soon (if ever), maybe these reservations are not needed and memory manger
> should create MSLs and enforce socket limits dynamically? This way most of the
> duplicated code can be removed, I think. Or does MSL reservation serve some
> other purposes?

MSL reservation serves the purpose of dynamically expanding memory 
usage. If there is no notion of NUMA nodes or multiple page sizes, then 
you can greatly simplify the code, but you'd still need *some* usage of 
MSL's if you plan to support dynamically allocating memory, or 
supporting externally allocated memory (i assume it's out of scope for 
now, since you can't do IOVA as VA).

So, yes, you could greatly simplify the memory management code *if* you 
were to go FreeBSD way and not allow dynamic page reservation. If you 
do, however, then i would guess that you'd end up writing something 
that's largely similar to existing Linux code (minus multiprocess) and 
so would just be duplicating effort.

> 
>>> diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c
>>> index 7c21aa921..9fa7bf352 100644
>>> --- a/lib/librte_eal/common/eal_common_memzone.c
>>> +++ b/lib/librte_eal/common/eal_common_memzone.c
>>> @@ -19,7 +19,14 @@
>>>    #include <rte_errno.h>
>>>    #include <rte_string_fns.h>
>>>    #include <rte_common.h>
>>> +
>>> +#ifndef RTE_EXEC_ENV_WINDOWS
>>>    #include <rte_eal_trace.h>
>>> +#else
>>> +#define rte_eal_trace_memzone_reserve(...)
>>> +#define rte_eal_trace_memzone_lookup(...)
>>> +#define rte_eal_trace_memzone_free(...)
>>> +#endif
>>>      
>>
>> Is it possible for rte_eal_trace.h to implement this workaround instead?
>> It wouldn't be very wise to have to have this in each file that depends
>> on rte_eal_trace.h.
> 
> I can add a patch that makes each tracepoint a no-op on Windows.
> 
> We discussed this issue (spreading workarounds) 2020-04-30 on Windows
> community call. The proper solution would be supporting trace on Windows, but
> IIRC no one is yet directly assigned to do that.

Apologies, i'm not plugged into those discussions :)

-- 
Thanks,
Anatoly


More information about the dev mailing list