linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Oscar Salvador <osalvador@techadventures.net>, linux-mm@kvack.org
Cc: mhocko@suse.com, dan.j.williams@intel.com,
	yasu.isimatu@gmail.com, rppt@linux.vnet.ibm.com,
	malat@debian.org, linux-kernel@vger.kernel.org,
	pavel.tatashin@microsoft.com, jglisse@redhat.com,
	Jonathan.Cameron@huawei.com, rafael@kernel.org,
	dave.jiang@intel.com, Oscar Salvador <osalvador@suse.de>
Subject: Re: [RFC PATCH v3 1/5] mm/memory_hotplug: Add nid parameter to arch_remove_memory
Date: Thu, 4 Oct 2018 11:52:09 +0200	[thread overview]
Message-ID: <df5ebe1d-2fd9-3015-321a-378bb160c4f0@redhat.com> (raw)
In-Reply-To: <20181002150029.23461-2-osalvador@techadventures.net>

On 02/10/2018 17:00, Oscar Salvador wrote:
> From: Oscar Salvador <osalvador@suse.de>
> 
> This patch is only a preparation for the following-up patches.
> The idea of passing the nid is that will allow us to get rid
> of the zone parameter in the patches that follow
> 
> Signed-off-by: Oscar Salvador <osalvador@suse.de>
> ---
>  arch/ia64/mm/init.c            | 2 +-
>  arch/powerpc/mm/mem.c          | 2 +-
>  arch/s390/mm/init.c            | 2 +-
>  arch/sh/mm/init.c              | 2 +-
>  arch/x86/mm/init_32.c          | 2 +-
>  arch/x86/mm/init_64.c          | 2 +-
>  include/linux/memory_hotplug.h | 2 +-
>  kernel/memremap.c              | 4 +++-
>  mm/memory_hotplug.c            | 2 +-
>  9 files changed, 11 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
> index d5e12ff1d73c..904fe55e10fc 100644
> --- a/arch/ia64/mm/init.c
> +++ b/arch/ia64/mm/init.c
> @@ -661,7 +661,7 @@ int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
>  }
>  
>  #ifdef CONFIG_MEMORY_HOTREMOVE
> -int arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
> +int arch_remove_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap)
>  {
>  	unsigned long start_pfn = start >> PAGE_SHIFT;
>  	unsigned long nr_pages = size >> PAGE_SHIFT;
> diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
> index 578cbb262c01..445fce705f91 100644
> --- a/arch/powerpc/mm/mem.c
> +++ b/arch/powerpc/mm/mem.c
> @@ -138,7 +138,7 @@ int __meminit arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *
>  }
>  
>  #ifdef CONFIG_MEMORY_HOTREMOVE
> -int __meminit arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
> +int __meminit arch_remove_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap)
>  {
>  	unsigned long start_pfn = start >> PAGE_SHIFT;
>  	unsigned long nr_pages = size >> PAGE_SHIFT;
> diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
> index e472cd763eb3..f705da1a085f 100644
> --- a/arch/s390/mm/init.c
> +++ b/arch/s390/mm/init.c
> @@ -239,7 +239,7 @@ int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
>  }
>  
>  #ifdef CONFIG_MEMORY_HOTREMOVE
> -int arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
> +int arch_remove_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap)
>  {
>  	/*
>  	 * There is no hardware or firmware interface which could trigger a
> diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
> index c8c13c777162..a8e5c0e00fca 100644
> --- a/arch/sh/mm/init.c
> +++ b/arch/sh/mm/init.c
> @@ -443,7 +443,7 @@ EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
>  #endif
>  
>  #ifdef CONFIG_MEMORY_HOTREMOVE
> -int arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
> +int arch_remove_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap)
>  {
>  	unsigned long start_pfn = PFN_DOWN(start);
>  	unsigned long nr_pages = size >> PAGE_SHIFT;
> diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
> index f2837e4c40b3..b2a698d87a0e 100644
> --- a/arch/x86/mm/init_32.c
> +++ b/arch/x86/mm/init_32.c
> @@ -860,7 +860,7 @@ int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
>  }
>  
>  #ifdef CONFIG_MEMORY_HOTREMOVE
> -int arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
> +int arch_remove_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap)
>  {
>  	unsigned long start_pfn = start >> PAGE_SHIFT;
>  	unsigned long nr_pages = size >> PAGE_SHIFT;
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index 5fab264948c2..c754d9543ae1 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -1147,7 +1147,7 @@ kernel_physical_mapping_remove(unsigned long start, unsigned long end)
>  	remove_pagetable(start, end, true, NULL);
>  }
>  
> -int __ref arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
> +int __ref arch_remove_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap)
>  {
>  	unsigned long start_pfn = start >> PAGE_SHIFT;
>  	unsigned long nr_pages = size >> PAGE_SHIFT;
> diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
> index ffd9cd10fcf3..f9fc35819e65 100644
> --- a/include/linux/memory_hotplug.h
> +++ b/include/linux/memory_hotplug.h
> @@ -107,7 +107,7 @@ static inline bool movable_node_is_enabled(void)
>  }
>  
>  #ifdef CONFIG_MEMORY_HOTREMOVE
> -extern int arch_remove_memory(u64 start, u64 size,
> +extern int arch_remove_memory(int nid, u64 start, u64 size,
>  		struct vmem_altmap *altmap);
>  extern int __remove_pages(struct zone *zone, unsigned long start_pfn,
>  	unsigned long nr_pages, struct vmem_altmap *altmap);
> diff --git a/kernel/memremap.c b/kernel/memremap.c
> index e3036433ce4e..fe54bba2d7e2 100644
> --- a/kernel/memremap.c
> +++ b/kernel/memremap.c
> @@ -121,6 +121,7 @@ static void devm_memremap_pages_release(void *data)
>  	struct resource *res = &pgmap->res;
>  	resource_size_t align_start, align_size;
>  	unsigned long pfn;
> +	int nid;
>  
>  	pgmap->kill(pgmap->ref);
>  	for_each_device_pfn(pfn, pgmap)
> @@ -130,6 +131,7 @@ static void devm_memremap_pages_release(void *data)
>  	align_start = res->start & ~(SECTION_SIZE - 1);
>  	align_size = ALIGN(res->start + resource_size(res), SECTION_SIZE)
>  		- align_start;
> +	nid = dev_to_node(dev);
>  
>  	mem_hotplug_begin();
>  	if (pgmap->type == MEMORY_DEVICE_PRIVATE) {
> @@ -137,7 +139,7 @@ static void devm_memremap_pages_release(void *data)
>  		__remove_pages(page_zone(pfn_to_page(pfn)), pfn,
>  				align_size >> PAGE_SHIFT, NULL);
>  	} else {
> -		arch_remove_memory(align_start, align_size,
> +		arch_remove_memory(nid, align_start, align_size,
>  				pgmap->altmap_valid ? &pgmap->altmap : NULL);
>  		kasan_remove_zero_shadow(__va(align_start), align_size);
>  	}
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index d4c7e42e46f3..11b7dcf83323 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -1890,7 +1890,7 @@ void __ref __remove_memory(int nid, u64 start, u64 size)
>  	memblock_free(start, size);
>  	memblock_remove(start, size);
>  
> -	arch_remove_memory(start, size, NULL);
> +	arch_remove_memory(nid, start, size, NULL);
>  
>  	try_offline_node(nid);
>  
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 

Thanks,

David / dhildenb

  reply	other threads:[~2018-10-04  9:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-02 15:00 [RFC PATCH v3 0/5] Do not touch pages/zones during hot-remove path Oscar Salvador
2018-10-02 15:00 ` [RFC PATCH v3 1/5] mm/memory_hotplug: Add nid parameter to arch_remove_memory Oscar Salvador
2018-10-04  9:52   ` David Hildenbrand [this message]
2018-10-02 15:00 ` [RFC PATCH v3 2/5] mm/memory_hotplug: Create add/del_device_memory functions Oscar Salvador
2018-10-02 15:00 ` [RFC PATCH v3 3/5] mm/memory_hotplug: Check for IORESOURCE_SYSRAM in release_mem_region_adjustable Oscar Salvador
2018-10-02 15:00 ` [RFC PATCH v3 4/5] mm/memory_hotplug: Move zone/pages handling to offline stage Oscar Salvador
2018-10-02 15:00 ` [RFC PATCH v3 5/5] mm/memory-hotplug: Rework unregister_mem_sect_under_nodes Oscar Salvador
2018-10-08 13:56 ` [RFC PATCH v3 0/5] Do not touch pages/zones during hot-remove path Oscar Salvador

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=df5ebe1d-2fd9-3015-321a-378bb160c4f0@redhat.com \
    --to=david@redhat.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=jglisse@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=malat@debian.org \
    --cc=mhocko@suse.com \
    --cc=osalvador@suse.de \
    --cc=osalvador@techadventures.net \
    --cc=pavel.tatashin@microsoft.com \
    --cc=rafael@kernel.org \
    --cc=rppt@linux.vnet.ibm.com \
    --cc=yasu.isimatu@gmail.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).