[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87o7ja9n2o.fsf@yhuang6-desk2.ccr.corp.intel.com>
Date: Mon, 14 Aug 2023 14:04:31 +0800
From: "Huang, Ying" <ying.huang@...el.com>
To: "Verma, Vishal L" <vishal.l.verma@...el.com>
Cc: "aneesh.kumar@...ux.ibm.com" <aneesh.kumar@...ux.ibm.com>,
"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
"Verma, Vishal L" <vishal.l.verma@...el.com> writes:
> 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) ?
I guess that we can just keep the original behavior. Originally, if
something goes wrong, arch_remove_memory() and remove_memory_block() (in
create_memory_block_devices()) will be called for all added memory
range. So, we should do that too?
--
Best Regards,
Huang, Ying
Powered by blists - more mailing lists