[bionic:linux][PATCH 0/2] LP:#1862312 - Segmentation fault (kernel oops) with memory-hotplug in ubuntu_kernel_selftests on Bionic kernel

Marcelo Henrique Cerri marcelo.cerri at canonical.com
Tue Feb 11 17:54:38 UTC 2020


The net difference after the patches are applied is the following:

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 6cd0c4a144d5..7dd8b84ea849 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -891,6 +891,8 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
 	int ret;
 	struct memory_notify arg;

+	mem_hotplug_begin();
+
 	nid = pfn_to_nid(pfn);
 	/* associate pfn range with the zone */
 	zone = move_pfn_range(online_type, nid, pfn, nr_pages);
@@ -904,8 +906,6 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
 	if (ret)
 		goto failed_addition;

-	mem_hotplug_begin();
-
 	/*
 	 * If this zone is not populated, then it is not in zonelist.
 	 * This means the page allocator ignores this zone.
@@ -1178,9 +1178,7 @@ int __ref add_memory_resource(int nid, struct resource *res, bool online)
 		walk_memory_range(PFN_DOWN(start), PFN_UP(start + size - 1),
 				  NULL, online_memory_block);

-
 	return ret;
-
 error:
 	/* rollback pgdat allocation and others */
 	if (new_pgdat && pgdat)


On Tue, Feb 11, 2020 at 02:43:57PM -0300, Marcelo Henrique Cerri wrote:
> BugLink: https://bugs.launchpad.net/bugs/1862312
> 
> The backport for upstream commit 381eab4a6ee8 (mm/memory_hotplug: fix
> online/offline_pages called w.o. mem_hotplug_lock) placed the call to
> mem_hotplug_begin() on the wrong location and caused a regression.
> 
> This patch set reverts the original backport and applies the right
> version.
> 
> ---
> David Hildenbrand (1):
>   mm/memory_hotplug: fix online/offline_pages called w.o.
>     mem_hotplug_lock
> 
> Marcelo Henrique Cerri (1):
>   Revert "mm/memory_hotplug: fix online/offline_pages called w.o.
>     mem_hotplug_lock"
> 
>  mm/memory_hotplug.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> -- 
> 2.20.1
> 

-- 
Regards,
Marcelo

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20200211/7aac25a3/attachment.sig>


More information about the kernel-team mailing list