v2
2026-11-04
页分配器稳定修复 · v2
包含 deferred free 的 ->private、page_frag 大片段、page_isolation slab 页、热插拔 zone seqlock 等稳定修复的 v2 更新。
原始补丁链接
子 Patch(5)
1/5
mm/page_alloc: clear ->private of deferred free pages
在 add_page_to_zone_llist() 入延迟队列前清 page->private,避免 split_large_buddy()/buddy 合并后非 head 页残留 order,触发 prep_compound_tail() 的 VM_WARN_ON_ONCE 或 Bad page state 泄漏。
2/5
mm: page_frag: refill the cache for large fragments
修正 __page_frag_alloc_align() 的大 fragment 判断:只有 fragsz 超过整页才失败,否则 nc->offset 不足时允许重新填充 page_frag_cache,避免 10K 接收缓冲在单页缓存下永久失败。
3/5
mm: page_isolation: do not take slab pages for free
修正 page_is_unmovable() 将 refcount 为 0 的 frozen slab 页误判为空闲的问题,在隔离/离线时把 slab 页视为不可移动并返回 -EBUSY,避免 offline_pages() 卡在无法回收的内存块。
4/5
mm/memory_hotplug: resize zones under their seqlock
让 memory hotplug 在 zone->span_seqlock 写临界区内更新 zone_start_pfn/spanned_pages,并关中断;避免 DEBUG_VM 的 bad_range 检查在字段异步更新间隙误判页越界触发 VM_BUG_ON_PAGE。
5/5
mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx()
删除 get_pfnblock_bitmap_bitidx() 中未加 span_seqlock 的 zone_spans_pfn() 调试检查,避免内存热插拔调整 zone 边界时与并发 free_unref_folios() 竞争触发 VM_BUG_ON_PAGE;该检查只是 debug sanity。