Skip to content

Commit 1c5ddc5

Browse files
kerneltoastkakra
authored andcommitted
ZEN: INTERACTIVE: mm: Lower the non-hugetlbpage pageblock size to reduce scheduling delays
The page allocator processes free pages in groups of pageblocks, where the size of a pageblock is typically quite large (1024 pages without hugetlbpage support). Pageblocks are processed atomically with the zone lock held, which can cause severe scheduling delays on both the CPU going through the pageblock and any other CPUs waiting to acquire the zone lock. A frequent offender is move_freepages_block(), which is used by rmqueue() for page allocation. As it turns out, there's no requirement for pageblocks to be so large, so the pageblock order can simply be reduced to ease the scheduling delays and zone lock contention. PAGE_ALLOC_COSTLY_ORDER is used as a reasonable setting to ensure non-costly page allocation requests can still be serviced without always needing to free up more than one pageblock's worth of pages at a time. This has a noticeable effect on overall system latency when memory pressure is elevated. The various mm functions which operate on pageblocks no longer appear in the preemptoff tracer, where previously they would spend up to 100 ms on a mobile arm64 CPU processing a pageblock with preemption disabled and the zone lock held. Signed-off-by: Sultan Alsawaf <[email protected]>
1 parent 12ac96c commit 1c5ddc5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

include/linux/pageblock-flags.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ extern unsigned int pageblock_order;
5252
#else /* CONFIG_TRANSPARENT_HUGEPAGE */
5353

5454
/* If huge pages are not used, group by MAX_ORDER_NR_PAGES */
55+
#ifdef CONFIG_ZEN_INTERACTIVE
56+
#define pageblock_order PAGE_ALLOC_COSTLY_ORDER
57+
#else
5558
#define pageblock_order MAX_PAGE_ORDER
59+
#endif
5660

5761
#endif /* CONFIG_HUGETLB_PAGE */
5862

init/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ config ZEN_INTERACTIVE
162162
MG-LRU minimum cache TTL.......: 0 -> 1000 ms
163163
Compact unevictable............: yes -> no
164164
Watermark boost factor.........: 1.5 -> 0
165+
Pageblock order................: 10 -> 3
165166

166167
--- EEVDF CPU Scheduler --------------------------------
167168

0 commit comments

Comments
 (0)