[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a6cb3c36069e2aaf9ce486c68ee4cb0973dd6b70.camel@intel.com>
Date: Fri, 6 Oct 2023 16:46:18 +0000
From: "Verma, Vishal L" <vishal.l.verma@...el.com>
To: "Williams, Dan J" <dan.j.williams@...el.com>,
"Jiang, Dave" <dave.jiang@...el.com>,
"osalvador@...e.de" <osalvador@...e.de>,
"david@...hat.com" <david@...hat.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
CC: "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"Huang, Ying" <ying.huang@...el.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"aneesh.kumar@...ux.ibm.com" <aneesh.kumar@...ux.ibm.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-cxl@...r.kernel.org" <linux-cxl@...r.kernel.org>,
"Hocko, Michal" <mhocko@...e.com>,
"nvdimm@...ts.linux.dev" <nvdimm@...ts.linux.dev>,
"jmoyer@...hat.com" <jmoyer@...hat.com>,
"Jonathan.Cameron@...wei.com" <Jonathan.Cameron@...wei.com>
Subject: Re: [PATCH v5 1/2] mm/memory_hotplug: split memmap_on_memory requests
across memblocks
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@...el.com>
Thanks Dan!
Powered by blists - more mailing lists