v11
2026-09-02
优化 ZONE_DEVICE memmap 初始化 · v11
v11为ZONE_DEVICE memmap初始化提速:模板快速路径、memcpy_nontemporal(),并扩展到compound尾部。
原始补丁链接
子 Patch(7)
1/7
mm: fix stale ZONE_DEVICE refcount comment
The comment in _init_zone_device_page() still uses the old MEMORY_TYPE* names and implies that FS_DAX pages regain a refcount of 1 in the free path. That no longer matches the code. Update the comm
2/7
mm: add a set_page_section_from_pfn() helper
Callers that want to update section bits from a PFN currently need to open-code: set_page_section(page, pfn_to_section_nr(pfn)); and guard that sequence with #ifdef SECTION_IN_PAGE_FLAGS. Add set_
3/7
mm: add a template-based fast path for zone-device page init
memmap_init_zone_device() repeats nearly identical head-page initialization for each PFN. Initialize the first real ZONE_DEVICE head page through the existing path, copy that final state into a reusab
4/7
mm: extend the template fast path to zone-device compound tails
The template fast path from the previous patch only accelerates head pages. Compound tails in memmap_init_compound() still go through the normal initialization path one by one. Build separate head an
5/7
string: introduce memcpy_nontemporal()
Introduce memcpy_nontemporal() for write-once copy sites that want a named non-temporal copy primitive. On x86_64, override the helper in arch/x86/include/asm/string_64.h using the usual self-macro p
6/7
mm: use memcpy_nontemporal() in zone-device template copies
The template fast path currently uses memcpy() for the actual struct page copy. Switch zone_device_page_init_from_template() to memcpy_nontemporal(). ZONE_DEVICE memmap initialization is largely writ
7/7
x86/string: extend memcpy_flushcache() fixed-size fastpaths
The x86 memcpy_nontemporal() helper maps to memcpy_flushcache(), and the ZONE_DEVICE template-copy path uses it to copy one struct page at a time. The relevant copy size is sizeof(struct page). On x8