diff mbox series

[4/4] mm/memory_hotplug: fix misplaced comment in offline_pages

Message ID 20220207133643.23427-5-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series A few cleanup patches around memory_hotplug | expand

Commit Message

Miaohe Lin Feb. 7, 2022, 1:36 p.m. UTC
It's misplaced since commit 7960509329c2 ("mm, memory_hotplug: print reason
for the offlining failure"). Move it to the right place.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/memory_hotplug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Hildenbrand Feb. 7, 2022, 2:45 p.m. UTC | #1
On 07.02.22 14:36, Miaohe Lin wrote:
> It's misplaced since commit 7960509329c2 ("mm, memory_hotplug: print reason
> for the offlining failure"). Move it to the right place.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  mm/memory_hotplug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 4b9eef861ee4..7dc7e12302db 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -1966,6 +1966,7 @@ int __ref offline_pages(unsigned long start_pfn, unsigned long nr_pages,
>  	return 0;
>  
>  failed_removal_isolated:
> +	/* pushback to free area */
>  	undo_isolate_page_range(start_pfn, end_pfn, MIGRATE_MOVABLE);
>  	memory_notify(MEM_CANCEL_OFFLINE, &arg);
>  failed_removal_pcplists_disabled:
> @@ -1976,7 +1977,6 @@ int __ref offline_pages(unsigned long start_pfn, unsigned long nr_pages,
>  		 (unsigned long long) start_pfn << PAGE_SHIFT,
>  		 ((unsigned long long) end_pfn << PAGE_SHIFT) - 1,
>  		 reason);
> -	/* pushback to free area */
>  	mem_hotplug_done();
>  	return ret;
>  }

Reviewed-by: David Hildenbrand <david@redhat.com>
Oscar Salvador Feb. 8, 2022, 10:12 a.m. UTC | #2
On Mon, Feb 07, 2022 at 09:36:43PM +0800, Miaohe Lin wrote:
> It's misplaced since commit 7960509329c2 ("mm, memory_hotplug: print reason
> for the offlining failure"). Move it to the right place.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Reviewed-by: Oscar Salvador <osalvador@suse.de>

> ---
>  mm/memory_hotplug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 4b9eef861ee4..7dc7e12302db 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -1966,6 +1966,7 @@ int __ref offline_pages(unsigned long start_pfn, unsigned long nr_pages,
>  	return 0;
>  
>  failed_removal_isolated:
> +	/* pushback to free area */
>  	undo_isolate_page_range(start_pfn, end_pfn, MIGRATE_MOVABLE);
>  	memory_notify(MEM_CANCEL_OFFLINE, &arg);
>  failed_removal_pcplists_disabled:
> @@ -1976,7 +1977,6 @@ int __ref offline_pages(unsigned long start_pfn, unsigned long nr_pages,
>  		 (unsigned long long) start_pfn << PAGE_SHIFT,
>  		 ((unsigned long long) end_pfn << PAGE_SHIFT) - 1,
>  		 reason);
> -	/* pushback to free area */
>  	mem_hotplug_done();
>  	return ret;
>  }
> -- 
> 2.23.0
> 
>
diff mbox series

Patch

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 4b9eef861ee4..7dc7e12302db 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1966,6 +1966,7 @@  int __ref offline_pages(unsigned long start_pfn, unsigned long nr_pages,
 	return 0;
 
 failed_removal_isolated:
+	/* pushback to free area */
 	undo_isolate_page_range(start_pfn, end_pfn, MIGRATE_MOVABLE);
 	memory_notify(MEM_CANCEL_OFFLINE, &arg);
 failed_removal_pcplists_disabled:
@@ -1976,7 +1977,6 @@  int __ref offline_pages(unsigned long start_pfn, unsigned long nr_pages,
 		 (unsigned long long) start_pfn << PAGE_SHIFT,
 		 ((unsigned long long) end_pfn << PAGE_SHIFT) - 1,
 		 reason);
-	/* pushback to free area */
 	mem_hotplug_done();
 	return ret;
 }