lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190409061200.GA10383@dhcp22.suse.cz>
Date:   Tue, 9 Apr 2019 08:12:00 +0200
From:   Michal Hocko <mhocko@...nel.org>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     Oscar Salvador <osalvador@...e.de>, david@...hat.com,
        dan.j.williams@...el.com, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org
Subject: Re: [PATCH v2 2/2] mm, memory_hotplug: provide a more generic
 restrictions for memory hotplug

On Mon 08-04-19 21:30:41, Andrew Morton wrote:
> On Mon,  8 Apr 2019 10:26:33 +0200 Oscar Salvador <osalvador@...e.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@...ux-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@...el.com>
> Cc: David Hildenbrand <david@...hat.com>
> Cc: Michal Hocko <mhocko@...e.com>
> Cc: Oscar Salvador <osalvador@...e.de>
> Signed-off-by: Andrew Morton <akpm@...ux-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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ