From: Oscar Salvador <osalvador@suse.de>
To: David Hildenbrand <david@redhat.com>
Cc: akpm@linux-foundation.org, mhocko@suse.com,
dan.j.williams@intel.com, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH 2/2] mm, memory_hotplug: provide a more generic restrictions for memory hotplug
Date: Thu, 4 Apr 2019 20:01:47 +0200 [thread overview]
Message-ID: <20190404180144.lgpf6qgnp67ib5s7@d104.suse.de> (raw)
In-Reply-To: <880c5d09-7d4e-2a97-e826-a8a6572216b2@redhat.com>
On Thu, Apr 04, 2019 at 04:57:03PM +0200, David Hildenbrand wrote:
> > #ifdef CONFIG_MEMORY_HOTPLUG
> > -int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
> > - bool want_memblock)
> > +int arch_add_memory(int nid, u64 start, u64 size,
> > + struct mhp_restrictions *restrictions)
>
> Should the restrictions be marked const?
We could, but maybe some platforms want to override something later on
depending on x or y configurations, so we could be more flexible here.
> > +/*
> > + * Do we want sysfs memblock files created. This will allow userspace to online
> > + * and offline memory explicitly. Lack of this bit means that the caller has to
> > + * call move_pfn_range_to_zone to finish the initialization.
> > + */
>
> I think you can be more precise here.
>
> "Create memory block devices for added pages. This is usually the case
> for all system ram (and only system ram), as only this way memory can be
> onlined/offlined by user space and kdump to correctly detect the new
> memory using udev events."
>
> Maybe we should even go a step further and call this
>
> MHP_SYSTEM_RAM
>
> Because that is what it is right now.
I agree that that is nicer explanation, and I would not mind to add it.
In the end, the more information and commented code the better.
But I am not really convinced by MHP_SYSTEM_RAM name, and I think we should stick
with MHP_MEMBLOCK_API because it represents __what__ is that flag about and its
function, e.g: create memory block devices.
> > @@ -1102,6 +1102,7 @@ int __ref add_memory_resource(int nid, struct resource *res)
> > u64 start, size;
> > bool new_node = false;
> > int ret;
> > + struct mhp_restrictions restrictions = {};
>
> I'd make this the very first variable.
>
> Also eventually
>
> struct mhp_restrictions restrictions = {
> .restrictions = MHP_MEMBLOCK_API
> };
It might be more right.
Actually, that is the way we tend to pre-initialize fields in structs.
About the identation, I am really puzzled, I checked my branch and I
cannot see any space that should be a tab.
Maybe it got screwed up when sending it.
Anyway, thanks for the feedback David ;-)
--
Oscar Salvador
SUSE L3
next prev parent reply other threads:[~2019-04-04 18:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-04 12:59 [PATCH 0/2] Preparing memhotplug for allocating memmap from hot-added range Oscar Salvador
2019-04-04 12:59 ` [PATCH 1/2] mm, memory_hotplug: cleanup memory offline path Oscar Salvador
2019-04-04 13:18 ` David Hildenbrand
2019-04-04 13:25 ` Oscar Salvador
2019-04-04 14:47 ` David Hildenbrand
2019-04-04 15:40 ` Oscar Salvador
2019-04-04 16:50 ` David Hildenbrand
2019-04-04 12:59 ` [PATCH 2/2] mm, memory_hotplug: provide a more generic restrictions for memory hotplug Oscar Salvador
2019-04-04 14:57 ` David Hildenbrand
2019-04-04 15:02 ` David Hildenbrand
2019-04-04 18:01 ` Oscar Salvador [this message]
2019-04-04 18:27 ` David Hildenbrand
2019-04-05 7:14 ` Michal Hocko
2019-04-05 8:05 ` David Hildenbrand
2019-04-05 10:30 ` Michal Hocko
2019-04-05 10:56 ` 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=20190404180144.lgpf6qgnp67ib5s7@d104.suse.de \
--to=osalvador@suse.de \
--cc=akpm@linux-foundation.org \
--cc=dan.j.williams@intel.com \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.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