* [REGRESSION] 6.12.y: HugeTLB vmemmap restore corrupts LRU links after THP split
@ 2026-11-27 20:05 Harshit Mogalapalli
2026-11-29 18:59 ` Sasha Levin
0 siblings, 1 reply; 2+ messages in thread
From: Harshit Mogalapalli @ 2026-11-27 20:05 UTC (permalink / raw)
To: stable, Greg Kroah-Hartman, Sasha Levin; +Cc: regressions
Hi Greg/Sasha,
We have hit a regression in our testing(with downstream kernel), and the
same problem is in 6.12.114+, the culprit is 4b7920465ee8
("mm/hugetlb_vmemmap: fix incorrect vmemmap restore in rollback").
Problem seen while running bunch of ltp tests with HVO enabled (hugepage
vmemmap optimization). The backport copies HugeTLB head metadata into
restored tail descriptors, leaving stale HugeTLB types when the memory
returns to the allocator. After that memory is reused as a THP and
split, incorrect HugeTLB accounting updates overwrite a neighboring
page’s LRU pointer.
[ 4184.918774] RIP: 0010:__list_del_entry_valid_or_report+0x37/0x5a
[ 4184.923355] Code: d2 74 4a 48 85 c9 0f 84 9f 00 00 00 48 b8 00 01 00
00 00 00 ad de 48 39 c2 74 7f 48 b8 22 01 00 00 00 00 ad de 48 39 c1 74
5c <48> 8b 31 48 39 fe 75 40 48 8b 42 08 48 39 c6 75 23 b8 01 00 00 00
[ 4184.940329] RSP: 0018:ffffd022c44e3888 EFLAGS: 00010002
[ 4184.945473] RAX: dead000000000122 RBX: fffff44387a1d040 RCX:
fffff44487a1d089
[ 4184.949857] RDX: fffff44387a1d008 RSI: 0000000000000000 RDI:
fffff44387a1d048
[ 4184.956880] RBP: 0000000000000001 R08: 0000000000000000 R09:
0000000000000000
[ 4184.963933] R10: 0000000000000000 R11: 0000000000000000 R12:
ffff8ddd7ffd4000
[ 4184.968986] R13: 00000000ffffffff R14: 0000000000000001 R15:
0000000000000001
[ 4184.973441] FS: 00007f6ec561b6c0(0000) GS:ffff8ddd6fc00000(0000)
knlGS:0000000000000000
[ 4184.978371] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 4184.983373] CR2: fffff44487a1d089 CR3: 0000000103344000 CR4:
00000000003506f0
[ 4184.987987] Call Trace:
[ 4184.990139] <TASK>
[ 4184.991921] lru_gen_del_folio.constprop.0+0x134/0x1d0
[ 4184.995324] __page_cache_release.part.0+0xa1/0x230
[ 4184.999332] __folio_put+0xd0/0x140
[ 4185.002169] __split_huge_page+0x514/0x720
[ 4185.005202] split_huge_page_to_list_to_order+0x804/0x9e8
[ 4185.008615] deferred_split_scan+0x297/0x4e0
[ 4185.011772] do_shrink_slab+0x13b/0x360
[ 4185.014685] shrink_slab_memcg+0x19e/0x290
[ 4185.017564] drop_slab+0x77/0x100
[ 4185.019906] drop_caches_sysctl_handler+0x94/0xa4
[ 4185.023090] proc_sys_call_handler+0x175/0x350
[ 4185.026031] vfs_write+0x29d/0x450
[ 4185.027975] ksys_write+0x6d/0xf0
[ 4185.031778] do_syscall_64+0x90/0x1c0
[
mm/hugetlb_vmemmap.c:__hugetlb_vmemmap_optimize_folio()
6.12.y (4b7920465ee8) shares the head backing page with the tails:
copy_page(page_to_virt(vmemmap_head), folio);
list_add(&vmemmap_head->lru, vmemmap_pages);
memmap_pages_add(1);
vmemmap_tail = vmemmap_head;
Upstream c7bde43f6daf uses a separate tail-only backing page:
vmemmap_tail = vmemmap_get_tail(h->order, folio_zone(folio));
if (!vmemmap_tail)
return -ENOMEM;
Both states use this in vmemmap_restore_pte():
copy_page(page_to_virt(dst), page_to_virt(src));
The upstream change relies on the separate tail-page representation
introduced by 622026e87c40 ("mm/hugetlb: remove fake head pages"). And
it can;'t be easily cherry-picked
I propose reverting 4b7920465ee8 pending a restoration change adapted
to the 6.12.y metadata layout.
Thanks,
Harshit
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-29 19:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 20:05 [REGRESSION] 6.12.y: HugeTLB vmemmap restore corrupts LRU links after THP split Harshit Mogalapalli
2026-11-29 18:59 ` Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox