Commit ab314175 authored by Liu Shixin's avatar Liu Shixin
Browse files

mm: prepare more high-order pages to be stored on the per-cpu lists

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 44042b44 ("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: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
parent 556d74a3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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)