
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I9OCYO -------------------------------- Both the file pages and anonymous pages support large folio, high-order pages except HPAGE_PMD_ORDER(PMD_SHIFT - PAGE_SHIFT) will be allocated frequently which will increase the zone lock contention, allow high-order pages on pcp lists could alleviate the big zone lock contention. Similar with lower order pages(order <= 3), allows one more high-order pages to be stored on the per-cpu lists. But as commit 44042b449872 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists") pointed, it may not win in all the scenes, so this don't allow higher-order pages to be added to PCP list, it will add a control to enable or disable it in future. The struct per_cpu_pages increases in size from 256(4 cache lines) to 320 bytes (5 cache lines) on arm64 with defconfig. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Liu Shixin <liushixin2@huawei.com> --- include/linux/mmzone.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index a394cbe31c59..bcf4fd4ab824 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -684,10 +684,12 @@ enum zone_watermarks { */ #ifdef CONFIG_TRANSPARENT_HUGEPAGE #define NR_PCP_THP 1 +#define NR_PCP_ORDERS (PAGE_ALLOC_COSTLY_ORDER + 2) #else #define NR_PCP_THP 0 +#define NR_PCP_ORDERS (PAGE_ALLOC_COSTLY_ORDER + 1) #endif -#define NR_LOWORDER_PCP_LISTS (MIGRATE_PCPTYPES * (PAGE_ALLOC_COSTLY_ORDER + 1)) +#define NR_LOWORDER_PCP_LISTS (MIGRATE_PCPTYPES * NR_PCP_ORDERS) #define NR_PCP_LISTS (NR_LOWORDER_PCP_LISTS + NR_PCP_THP) #define min_wmark_pages(z) (z->_watermark[WMARK_MIN] + z->watermark_boost) -- 2.25.1