[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e3c253709ff5fd6a456d4b28b94b8a8a6b12be44.camel@intel.com>
Date: Wed, 2 Aug 2023 06:02:12 +0000
From: "Verma, Vishal L" <vishal.l.verma@...el.com>
To: "Huang, Ying" <ying.huang@...el.com>,
"aneesh.kumar@...ux.ibm.com" <aneesh.kumar@...ux.ibm.com>
CC: "david@...hat.com" <david@...hat.com>,
"Jiang, Dave" <dave.jiang@...el.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"osalvador@...e.de" <osalvador@...e.de>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Williams, Dan J" <dan.j.williams@...el.com>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"Jonathan.Cameron@...wei.com" <Jonathan.Cameron@...wei.com>,
"nvdimm@...ts.linux.dev" <nvdimm@...ts.linux.dev>,
"jmoyer@...hat.com" <jmoyer@...hat.com>,
"linux-cxl@...r.kernel.org" <linux-cxl@...r.kernel.org>
Subject: Re: [PATCH v2 2/3] mm/memory_hotplug: split memmap_on_memory requests
across memblocks
On Mon, 2023-07-24 at 11:16 +0800, Huang, Ying wrote:
> "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com> writes:
> >
> > > @@ -1339,27 +1367,20 @@ int __ref add_memory_resource(int nid,
> > > struct resource *res, mhp_t mhp_flags)
> > > /*
> > > * Self hosted memmap array
> > > */
> > > - if (mhp_flags & MHP_MEMMAP_ON_MEMORY) {
> > > - if (!mhp_supports_memmap_on_memory(size)) {
> > > - ret = -EINVAL;
> > > + if ((mhp_flags & MHP_MEMMAP_ON_MEMORY) &&
> > > + mhp_supports_memmap_on_memory(memblock_size)) {
> > > + for (cur_start = start; cur_start < start + size;
> > > + cur_start += memblock_size) {
> > > + ret = add_memory_create_devices(nid,
> > > group, cur_start,
> > > + memblock_
> > > size,
> > > + mhp_flags
> > > );
> > > + if (ret)
> > > + goto error;
> > > + }
> >
> > We should handle the below error details here.
> >
> > 1) If we hit an error after some blocks got added, should we
> > iterate over rest of the dev_dax->nr_range.
> > 2) With some blocks added if we return a failure here, we remove
> > the
> > resource in dax_kmem. Is that ok?
> >
> > IMHO error handling with partial creation of memory blocks in a
> > resource range should be
> > documented with this change.
>
> Or, should we remove all added memory blocks upon error?
>
I didn't address these in v3 - I wasn't sure how we'd proceed here.
Something obviously went very wrong and I'd imagine it is okay if this
memory is unusable as a result.
What woyuld removing the blocks we added look like? Just call
try_remove_memory() from the error path in add_memory_resource()? (for
a range of [start, cur_start) ?
Powered by blists - more mailing lists