From: "Huang, Ying" <ying.huang@intel.com>
To: "Verma, Vishal L" <vishal.l.verma@intel.com>
Cc: "aneesh.kumar@linux.ibm.com" <aneesh.kumar@linux.ibm.com>,
"david@redhat.com" <david@redhat.com>,
"Jiang, Dave" <dave.jiang@intel.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"osalvador@suse.de" <osalvador@suse.de>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Williams, Dan J" <dan.j.williams@intel.com>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"Jonathan.Cameron@Huawei.com" <Jonathan.Cameron@Huawei.com>,
"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>,
"jmoyer@redhat.com" <jmoyer@redhat.com>,
"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] mm/memory_hotplug: split memmap_on_memory requests across memblocks
Date: Mon, 14 Aug 2023 14:04:31 +0800 [thread overview]
Message-ID: <87o7ja9n2o.fsf@yhuang6-desk2.ccr.corp.intel.com> (raw)
In-Reply-To: <e3c253709ff5fd6a456d4b28b94b8a8a6b12be44.camel@intel.com> (Vishal L. Verma's message of "Wed, 2 Aug 2023 14:02:12 +0800")
"Verma, Vishal L" <vishal.l.verma@intel.com> writes:
> On Mon, 2023-07-24 at 11:16 +0800, Huang, Ying wrote:
>> "Aneesh Kumar K.V" <aneesh.kumar@linux.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
next prev parent reply other threads:[~2023-08-14 6:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 7:14 [PATCH v2 0/3] mm: use memmap_on_memory semantics for dax/kmem Vishal Verma
2023-07-20 7:14 ` [PATCH v2 1/3] mm/memory_hotplug: Export symbol mhp_supports_memmap_on_memory() Vishal Verma
2023-07-24 6:00 ` Huang, Ying
2023-07-20 7:14 ` [PATCH v2 2/3] mm/memory_hotplug: split memmap_on_memory requests across memblocks Vishal Verma
2023-07-21 12:20 ` Aneesh Kumar K.V
2023-07-23 14:53 ` Aneesh Kumar K.V
2023-07-24 3:16 ` Huang, Ying
2023-08-02 6:02 ` Verma, Vishal L
2023-08-14 6:04 ` Huang, Ying [this message]
2023-07-24 5:54 ` Huang, Ying
2023-08-02 6:08 ` Verma, Vishal L
2023-08-14 6:45 ` Huang, Ying
2023-08-14 7:20 ` David Hildenbrand
2023-07-20 7:14 ` [PATCH v2 3/3] dax/kmem: allow kmem to add memory with memmap_on_memory Vishal Verma
2023-07-25 15:54 ` [PATCH v2 0/3] mm: use memmap_on_memory semantics for dax/kmem David Hildenbrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o7ja9n2o.fsf@yhuang6-desk2.ccr.corp.intel.com \
--to=ying.huang@intel.com \
--cc=Jonathan.Cameron@Huawei.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.ibm.com \
--cc=dan.j.williams@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=dave.jiang@intel.com \
--cc=david@redhat.com \
--cc=jmoyer@redhat.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nvdimm@lists.linux.dev \
--cc=osalvador@suse.de \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).