lkml.org 
[lkml]   [2023]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH v5 1/2] mm/memory_hotplug: split memmap_on_memory requests across memblocks
    Date
    On Thu, 2023-10-05 at 14:20 -0700, Dan Williams wrote:
    > Vishal Verma wrote:
    <..>
    > >
    > > --- a/mm/memory_hotplug.c
    > > +++ b/mm/memory_hotplug.c
    > > @@ -1380,6 +1380,44 @@ static bool mhp_supports_memmap_on_memory(unsigned long size)
    > >         return arch_supports_memmap_on_memory(vmemmap_size);
    > >  }
    > >  
    > > +static int add_memory_create_devices(int nid, struct memory_group *group,
    > > +                                    u64 start, u64 size, mhp_t mhp_flags)
    > > +{
    > > +       struct mhp_params params = { .pgprot = pgprot_mhp(PAGE_KERNEL) };
    > > +       struct vmem_altmap mhp_altmap = {
    > > +               .base_pfn =  PHYS_PFN(start),
    > > +               .end_pfn  =  PHYS_PFN(start + size - 1),
    > > +       };
    > > +       int ret;
    > > +
    > > +       if ((mhp_flags & MHP_MEMMAP_ON_MEMORY)) {
    > > +               mhp_altmap.free = memory_block_memmap_on_memory_pages();
    > > +               params.altmap = kmalloc(sizeof(struct vmem_altmap), GFP_KERNEL);
    > > +               if (!params.altmap)
    > > +                       return -ENOMEM;
    > > +
    > > +               memcpy(params.altmap, &mhp_altmap, sizeof(mhp_altmap));
    >
    > Isn't this just open coded kmemdup()?

    Ah yes - it was existing code that I just moved, but I can add a
    precursor cleanup patch to change it.

    >
    > Other than that, I am not seeing anything else to comment on, you can add:
    >
    > Reviewed-by: Dan Williams <dan.j.williams@intel.com>

    Thanks Dan!

    \
     
     \ /
      Last update: 2023-10-06 18:47    [W:8.536 / U:0.176 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site