Skip to content

Commit ed21f9c

Browse files
damentzkakra
authored andcommitted
ZEN: INTERACTIVE: mm/swap: Disable swap-in readahead
Per an [issue][1] on the chromium project, swap-in readahead causes more jank than not. This might be caused by poor optimization on the swapping code, or the fact under memory pressure, we're pulling in pages we don't need, causing more swapping. Either way, this is mainline/upstream to Chromium, and ChromeOS developers care a lot about system responsiveness. Lets implement the same change so Zen Kernel users benefit. [1]: https://bugs.chromium.org/p/chromium/issues/detail?id=263561 Signed-off-by: Kai Krakow <[email protected]>
1 parent e3ca973 commit ed21f9c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

init/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ config ZEN_INTERACTIVE
165165
Compaction proactiveness.......: 20 -> 0
166166
Watermark boost factor.........: 1.5 -> 0
167167
Pageblock order................: 10 -> 3
168+
Swap-in readahead..............: 3 -> 0
168169

169170
--- EEVDF CPU Scheduler --------------------------------
170171

mm/swap.c

+5
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,10 @@ void folio_batch_remove_exceptionals(struct folio_batch *fbatch)
10801080
*/
10811081
void __init swap_setup(void)
10821082
{
1083+
#ifdef CONFIG_ZEN_INTERACTIVE
1084+
/* Only swap-in pages requested, avoid readahead */
1085+
page_cluster = 0;
1086+
#else
10831087
unsigned long megs = totalram_pages() >> (20 - PAGE_SHIFT);
10841088

10851089
/* Use a smaller cluster for small-memory machines */
@@ -1091,4 +1095,5 @@ void __init swap_setup(void)
10911095
* Right now other parts of the system means that we
10921096
* _really_ don't want to cluster much more
10931097
*/
1098+
#endif
10941099
}

0 commit comments

Comments
 (0)