linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Oscar Salvador <osalvador@suse.de>,
	david@redhat.com, dan.j.williams@intel.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH v2 2/2] mm, memory_hotplug: provide a more generic restrictions for memory hotplug
Date: Tue, 9 Apr 2019 08:12:00 +0200	[thread overview]
Message-ID: <20190409061200.GA10383@dhcp22.suse.cz> (raw)
In-Reply-To: <20190408213041.50350dac32ed315839c57e09@linux-foundation.org>

On Mon 08-04-19 21:30:41, Andrew Morton wrote:
> On Mon,  8 Apr 2019 10:26:33 +0200 Oscar Salvador <osalvador@suse.de> wrote:
> 
> > arch_add_memory, __add_pages take a want_memblock which controls whether
> > the newly added memory should get the sysfs memblock user API (e.g.
> > ZONE_DEVICE users do not want/need this interface). Some callers even
> > want to control where do we allocate the memmap from by configuring
> > altmap.
> > 
> > Add a more generic hotplug context for arch_add_memory and __add_pages.
> > struct mhp_restrictions contains flags which contains additional
> > features to be enabled by the memory hotplug (MHP_MEMBLOCK_API
> > currently) and altmap for alternative memmap allocator.
> > 
> > This patch shouldn't introduce any functional change.
> 
> From: Andrew Morton <akpm@linux-foundation.org>
> Subject: mm-memory_hotplug-provide-a-more-generic-restrictions-for-memory-hotplug-fix
> 
> x86_64 allnoconfig:
> 
> In file included from ./include/linux/mmzone.h:744:0,
>                  from ./include/linux/gfp.h:6,
>                  from ./include/linux/umh.h:4,
>                  from ./include/linux/kmod.h:22,
>                  from ./include/linux/module.h:13,
>                  from init/do_mounts.c:1:
> ./include/linux/memory_hotplug.h:353:11: warning: ‘struct mhp_restrictions’ declared inside parameter list will not be visible outside of this definition or declaration
>     struct mhp_restrictions *restrictions);
>            ^~~~~~~~~~~~~~~~
> 
> Fix this by moving the arch_add_memory() definition inside
> CONFIG_MEMORY_HOTPLUG and moving the mhp_restrictions definition to a more
> appropriate place.

LGTM. Thanks for the fixup!

> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Oscar Salvador <osalvador@suse.de>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  include/linux/memory_hotplug.h |   24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> --- a/include/linux/memory_hotplug.h~mm-memory_hotplug-provide-a-more-generic-restrictions-for-memory-hotplug-fix
> +++ a/include/linux/memory_hotplug.h
> @@ -54,6 +54,16 @@ enum {
>  };
>  
>  /*
> + * Restrictions for the memory hotplug:
> + * flags:  MHP_ flags
> + * altmap: alternative allocator for memmap array
> + */
> +struct mhp_restrictions {
> +	unsigned long flags;
> +	struct vmem_altmap *altmap;
> +};
> +
> +/*
>   * Zone resizing functions
>   *
>   * Note: any attempt to resize a zone should has pgdat_resize_lock()
> @@ -101,6 +111,8 @@ extern void __online_page_free(struct pa
>  
>  extern int try_online_node(int nid);
>  
> +extern int arch_add_memory(int nid, u64 start, u64 size,
> +			struct mhp_restrictions *restrictions);
>  extern u64 max_mem_size;
>  
>  extern bool memhp_auto_online;
> @@ -126,16 +138,6 @@ extern int __remove_pages(struct zone *z
>  
>  #define MHP_MEMBLOCK_API               (1<<0)
>  
> -/*
> - * Restrictions for the memory hotplug:
> - * flags:  MHP_ flags
> - * altmap: alternative allocator for memmap array
> - */
> -struct mhp_restrictions {
> -	unsigned long flags;
> -	struct vmem_altmap *altmap;
> -};
> -
>  /* reasonably generic interface to expand the physical pages */
>  extern int __add_pages(int nid, unsigned long start_pfn, unsigned long nr_pages,
>  		       struct mhp_restrictions *restrictions);
> @@ -349,8 +351,6 @@ extern int walk_memory_range(unsigned lo
>  extern int __add_memory(int nid, u64 start, u64 size);
>  extern int add_memory(int nid, u64 start, u64 size);
>  extern int add_memory_resource(int nid, struct resource *resource);
> -extern int arch_add_memory(int nid, u64 start, u64 size,
> -			struct mhp_restrictions *restrictions);
>  extern void move_pfn_range_to_zone(struct zone *zone, unsigned long start_pfn,
>  		unsigned long nr_pages, struct vmem_altmap *altmap);
>  extern bool is_memblock_offlined(struct memory_block *mem);
> _
> 

-- 
Michal Hocko
SUSE Labs


      reply	other threads:[~2019-04-09  6:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08  8:26 [PATCH v2 0/2] Preparing memhotplug for allocating memmap from hot-added range Oscar Salvador
2019-04-08  8:26 ` [PATCH v2 1/2] mm, memory_hotplug: cleanup memory offline path Oscar Salvador
2019-04-08  8:26 ` [PATCH v2 2/2] mm, memory_hotplug: provide a more generic restrictions for memory hotplug Oscar Salvador
2019-04-09  4:30   ` Andrew Morton
2019-04-09  6:12     ` Michal Hocko [this message]

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=20190409061200.GA10383@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --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=osalvador@suse.de \
    /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).