diff mbox series

[v2,1/4] mm, page_owner: handle THP splits correctly

Message ID 20190820131828.22684-2-vbabka@suse.cz (mailing list archive)
State New, archived
Headers show
Series debug_pagealloc improvements through page_owner | expand

Commit Message

Vlastimil Babka Aug. 20, 2019, 1:18 p.m. UTC
THP splitting path is missing the split_page_owner() call that split_page()
has. As a result, split THP pages are wrongly reported in the page_owner file
as order-9 pages. Furthermore when the former head page is freed, the remaining
former tail pages are not listed in the page_owner file at all. This patch
fixes that by adding the split_page_owner() call into __split_huge_page().

Fixes: a9627bc5e34e ("mm/page_owner: introduce split_page_owner and replace manual handling")
Reported-by: Kirill A. Shutemov <kirill@shutemov.name>
Cc: stable@vger.kernel.org
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
 mm/huge_memory.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Sasha Levin Aug. 20, 2019, 3:16 p.m. UTC | #1
Hi,

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag,
fixing commit: a9627bc5e34e mm/page_owner: introduce split_page_owner and replace manual handling.

The bot has tested the following trees: v5.2.9, v4.19.67, v4.14.139, v4.9.189.

v5.2.9: Build OK!
v4.19.67: Failed to apply! Possible dependencies:
    426dcd4b600f ("hexagon: switch to NO_BOOTMEM")
    46515fdb1adf ("ixgbe: move common Rx functions to ixgbe_txrx_common.h")
    57c8a661d95d ("mm: remove include/linux/bootmem.h")
    6471f52af786 ("alpha: switch to NO_BOOTMEM")
    98fa15f34cb3 ("mm: replace all open encodings for NUMA_NO_NODE")
    d0bcacd0a130 ("ixgbe: add AF_XDP zero-copy Rx support")
    e0a9317d9004 ("hexagon: use generic dma_noncoherent_ops")
    f406f222d4b2 ("hexagon: implement the sync_sg_for_device DMA operation")

v4.14.139: Failed to apply! Possible dependencies:
    01417c6cc7dc ("powerpc/64: Change soft_enabled from flag to bitmask")
    0b63acf4a0eb ("powerpc/64: Move set_soft_enabled() and rename")
    1696d0fb7fcd ("powerpc/64: Set DSCR default initially from SPR")
    1af19331a3a1 ("powerpc/64s: Relax PACA address limitations")
    4890aea65ae7 ("powerpc/64: Allocate pacas per node")
    4e26bc4a4ed6 ("powerpc/64: Rename soft_enabled to irq_soft_mask")
    8e0b634b1327 ("powerpc/64s: Do not allocate lppaca if we are not virtualized")
    98fa15f34cb3 ("mm: replace all open encodings for NUMA_NO_NODE")
    9f83e00f4cc1 ("powerpc/64: Improve inline asm in arch_local_irq_disable")
    b5c1bd62c054 ("powerpc/64: Fix arch_local_irq_disable() prototype")
    c2e480ba8227 ("powerpc/64: Add #defines for paca->soft_enabled flags")
    ff967900c9d4 ("powerpc/64: Fix latency tracing for lazy irq replay")

v4.9.189: Failed to apply! Possible dependencies:
    010426079ec1 ("sched/headers: Prepare for new header dependencies before moving more code to <linux/sched/mm.h>")
    2077be6783b5 ("arm64: Use __pa_symbol for kernel symbols")
    39bc88e5e38e ("arm64: Disable TTBR0_EL1 during normal kernel execution")
    3f07c0144132 ("sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h>")
    68db0cf10678 ("sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h>")
    7c0f6ba682b9 ("Replace <asm/uaccess.h> with <linux/uaccess.h> globally")
    869dcfd10dfe ("arm64: Add cast for virt_to_pfn")
    9164bb4a18df ("sched/headers: Prepare to move 'init_task' and 'init_thread_union' from <linux/sched.h> to <linux/sched/task.h>")
    98fa15f34cb3 ("mm: replace all open encodings for NUMA_NO_NODE")
    9cf09d68b89a ("arm64: xen: Enable user access before a privcmd hvc call")
    bd38967d406f ("arm64: Factor out PAN enabling/disabling into separate uaccess_* macros")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

--
Thanks,
Sasha
diff mbox series

Patch

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 738065f765ab..de1f15969e27 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -32,6 +32,7 @@ 
 #include <linux/shmem_fs.h>
 #include <linux/oom.h>
 #include <linux/numa.h>
+#include <linux/page_owner.h>
 
 #include <asm/tlb.h>
 #include <asm/pgalloc.h>
@@ -2516,6 +2517,9 @@  static void __split_huge_page(struct page *page, struct list_head *list,
 	}
 
 	ClearPageCompound(head);
+
+	split_page_owner(head, HPAGE_PMD_ORDER);
+
 	/* See comment in __split_huge_page_tail() */
 	if (PageAnon(head)) {
 		/* Additional pin to swap cache */