Skip to contentSkip to conversation

Patch "percpu: don't forget to free the temporary struct pcpu_alloc_info" has been added to the 3.18-stable tree

PATCH [email protected] 1 participant 1 message Dec 21, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

percpu: don't forget to free the temporary struct pcpu_alloc_info

to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
percpu-don-t-forget-to-free-the-temporary-struct-pcpu_alloc_info.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Thu Dec 21 10:55:04 CET 2017

From: Nicolas Pitre <[email protected]>
Date: Tue, 3 Oct 2017 18:29:49 -0400
Subject: percpu: don't forget to free the temporary struct pcpu_alloc_info

From: Nicolas Pitre <[email protected]>

[ Upstream commit 438a50618095061920d3a30d4c5ca1ef2e0ff860 ]

Unlike the SMP case, the !SMP case does not free the memory for struct pcpu_alloc_info allocated in setup_per_cpu_areas(). And to give it a chance of being reused by the page allocator later, align it to a page boundary just like its size.

---
 mm/percpu.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
mm/percpu.c +2 -1
@@ -1402,7 +1402,7 @@ struct pcpu_alloc_info * __init pcpu_all
 			  __alignof__(ai->groups[0].cpu_map[0]));
 	ai_size = base_size + nr_units * sizeof(ai->groups[0].cpu_map[0]);
 
-	ptr = memblock_virt_alloc_nopanic(PFN_ALIGN(ai_size), 0);
+	ptr = memblock_virt_alloc_nopanic(PFN_ALIGN(ai_size), PAGE_SIZE);
 	if (!ptr)
 		return NULL;
 	ai = ptr;
@@ -2268,6 +2268,7 @@ void __init setup_per_cpu_areas(void)
 
 	if (pcpu_setup_first_chunk(ai, fc) < 0)
 		panic("Failed to initialize percpu areas.");
+	pcpu_free_alloc_info(ai);
 }
 
 #endif	/* CONFIG_SMP */

Patches currently in stable-queue which might be from [email protected] are

queue-3.18/percpu-don-t-forget-to-free-the-temporary-struct-pcpu_alloc_info.patch