RE: Re: FW: [LSF/MM/BPF TOPIC] SMDK inspired MM changes for CXL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>On 31.03.23 13:42, Kyungsan Kim wrote:
>>> On 24.03.23 14:08, Jørgen Hansen wrote:
>>>>
>>>>> On 24 Mar 2023, at 10.50, Kyungsan Kim <ks0204.kim@xxxxxxxxxxx> wrote:
>>>>>
>>>>>> On 24.03.23 10:27, Kyungsan Kim wrote:
>>>>>>>> On 24.03.23 10:09, Kyungsan Kim wrote:
>>>>>>>>> Thank you David Hinderbrand for your interest on this topic.
>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> Kyungsan Kim wrote:
>>>>>>>>>>>> [..]
>>>>>>>>>>>>>> In addition to CXL memory, we may have other kind of memory in the
>>>>>>>>>>>>>> system, for example, HBM (High Bandwidth Memory), memory in FPGA card,
>>>>>>>>>>>>>> memory in GPU card, etc.  I guess that we need to consider them
>>>>>>>>>>>>>> together.  Do we need to add one zone type for each kind of memory?
>>>>>>>>>>>>>
>>>>>>>>>>>>> We also don't think a new zone is needed for every single memory
>>>>>>>>>>>>> device.  Our viewpoint is the sole ZONE_NORMAL becomes not enough to
>>>>>>>>>>>>> manage multiple volatile memory devices due to the increased device
>>>>>>>>>>>>> types.  Including CXL DRAM, we think the ZONE_EXMEM can be used to
>>>>>>>>>>>>> represent extended volatile memories that have different HW
>>>>>>>>>>>>> characteristics.
>>>>>>>>>>>>
>>>>>>>>>>>> Some advice for the LSF/MM discussion, the rationale will need to be
>>>>>>>>>>>> more than "we think the ZONE_EXMEM can be used to represent extended
>>>>>>>>>>>> volatile memories that have different HW characteristics". It needs to
>>>>>>>>>>>> be along the lines of "yes, to date Linux has been able to describe DDR
>>>>>>>>>>>> with NUMA effects, PMEM with high write overhead, and HBM with improved
>>>>>>>>>>>> bandwidth not necessarily latency, all without adding a new ZONE, but a
>>>>>>>>>>>> new ZONE is absolutely required now to enable use case FOO, or address
>>>>>>>>>>>> unfixable NUMA problem BAR." Without FOO and BAR to discuss the code
>>>>>>>>>>>> maintainability concern of "fewer degress of freedom in the ZONE
>>>>>>>>>>>> dimension" starts to dominate.
>>>>>>>>>>>
>>>>>>>>>>> One problem we experienced was occured in the combination of hot-remove and kerelspace allocation usecases.
>>>>>>>>>>> ZONE_NORMAL allows kernel context allocation, but it does not allow hot-remove because kernel resides all the time.
>>>>>>>>>>> ZONE_MOVABLE allows hot-remove due to the page migration, but it only allows userspace allocation.
>>>>>>>>>>> Alternatively, we allocated a kernel context out of ZONE_MOVABLE by adding GFP_MOVABLE flag.
>>>>>>>>>
>>>>>>>>>> That sounds like a bad hack :) .
>>>>>>>>> I consent you.
>>>>>>>>>
>>>>>>>>>>> In case, oops and system hang has occasionally occured because ZONE_MOVABLE can be swapped.
>>>>>>>>>>> We resolved the issue using ZONE_EXMEM by allowing seletively choice of the two usecases.
>>>>>>>>>
>>>>>>>>>> I once raised the idea of a ZONE_PREFER_MOVABLE [1], maybe that's
>>>>>>>>>> similar to what you have in mind here. In general, adding new zones is
>>>>>>>>>> frowned upon.
>>>>>>>>>
>>>>>>>>> Actually, we have already studied your idea and thought it is similar with us in 2 aspects.
>>>>>>>>> 1. ZONE_PREFER_MOVABLE allows a kernelspace allocation using a new zone
>>>>>>>>> 2. ZONE_PREFER_MOVABLE helps less fragmentation by splitting zones, and ordering allocation requests from the zones.
>>>>>>>>>
>>>>>>>>> We think ZONE_EXMEM also helps less fragmentation.
>>>>>>>>> Because it is a separated zone and handles a page allocation as movable by default.
>>>>>>>>
>>>>>>>> So how is it different that it would justify a different (more confusing
>>>>>>>> IMHO) name? :) Of course, names don't matter that much, but I'd be
>>>>>>>> interested in which other aspect that zone would be "special".
>>>>>>>
>>>>>>> FYI for the first time I named it as ZONE_CXLMEM, but we thought it would be needed to cover other extended memory types as well.
>>>>>>> So I changed it as ZONE_EXMEM.
>>>>>>> We also would like to point out a "special" zone aspeact, which is different from ZONE_NORMAL for tranditional DDR DRAM.
>>>>>>> Of course, a symbol naming is important more or less to represent it very nicely, though.
>>>>>>> Do you prefer ZONE_SPECIAL? :)
>>>>>>
>>>>>> I called it ZONE_PREFER_MOVABLE. If you studied that approach there must
>>>>>> be a good reason to name it differently?
>>>>>>
>>>>>
>>>>> The intention of ZONE_EXMEM is a separated logical management dimension originated from the HW diffrences of extended memory devices.
>>>>> Althought the ZONE_EXMEM considers the movable and frementation aspect, it is not all what ZONE_EXMEM considers.
>>>>> So it is named as it.
>>>>
>>>> Given that CXL memory devices can potentially cover a wide range of technologies with quite different latency and bandwidth metrics, will one zone serve as the management vehicle that you seek? If a system contains both CXL attached DRAM and, let say, a byte-addressable CXL SSD - both used as (different) byte addressable tiers in a tiered memory hierarchy, allocating memory from the ZONE_EXMEM doesn’t really tell you much about what you get. So the client would still need an orthogonal method to characterize the desired performance characteristics. This method could be combined with a fabric independent zone such as ZONE_PREFER_MOVABLE to address the kernel allocation issue. At the same time, this new zone could also be useful in other cases, such as virtio-mem.
>>>
>>> Yes. I still did not get a satisfying answer to my original question:
>>> what would be the differences between both zones from a MM point of
>>> view? We can discuss that in the session, of course.
>>>
>>> Regarding performance differences, I thought the idea was to go with
>>> different nodes to express (and model) such.
>>>
>> 
>>  From a MM point of view on the movability aspect, a kernel context is not allocated from ZONE_EXMEM without using GFP_EXMEM explicitly.
>> In contrast, if we understand the design of ZONE_PREFER_MOVABLE correctly, a kernel context can be allocated from ZONE_PREFER_MOVABLE implicitly as the fallback of ZONE_NORMAL allocation.
>> However, the movable attribute is not all we are concerning.
>> In addition, we experienced page allocation and migration issue on the heterogeneous memories.
>> 
>> Given our experiences/design and industry's viewpoints/inquiries,
>> I will prepare a few slides in the session to explain
>>    1. Usecase - user/kernespace memory tiering for near/far placement, memory virtualization between hypervisor/baremetal OS
>>    2. Issue - movability(movable/unmovable), allocation(explicit/implicit), migration(intented/unintended)
>>    3. HW - topology(direct, switch, fabric), feature(pluggability,error-handling,etc)
>
>Yes, especially a motivation for GFP_EXMEM and ZONE_EXMEM would be 
>great. New GFP flags and zone are very likely a lot of upstream 
>pushback. So we need a clear motivation and discussion of alternatives 
>(and why this memory has to be treated so special but still wants to be 
>managed by the buddy).
>
>Willy raises some very good points.
>

Please find the slide in preparation[1].
To help clarity, we included SW blocks and interaction of the proposal.

[1] https://github.com/OpenMPDK/SMDK/wiki/93.-%5BLSF-MM-BPF-TOPIC%5D-SMDK-inspired-MM-changes-for-CXL

>-- 
>Thanks,
>
>David / dhildenb




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux