Skip to content

Commit

Permalink
ZEN: INTERACTIVE: Disable compaction of unevictable pages
Browse files Browse the repository at this point in the history
5.4:
Disable compaction for unevictable memory.

Compaction of running memory is a good thing.  It's also required to
properly allocate memory for large applications, like new processes in
Chrome or make room for a large virtual machine.  Unfortunately, the
default configuration of Linux allows all memory to be compacted.

This is a good thing for servers.  An application running server side
can tolerate micro stalls since the latency impact is almost not
measurable (depending on the application, of course).  But on a desktop
configuration with X, Wayland, Gnome, KDE, etc, the dropped frames and
lost input are very obvious.

Lets prevent these applications from having their memory moved during
compaction.  Although compaction will take longer and new processes will
take longer to spawn under high memory pressure / external memory
fragmentation, the actual experience of the system will feel more
responsive and consistent under these adverse conditions.
  • Loading branch information
heftig committed Jan 27, 2020
1 parent 598f06b commit 394ae0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions init/Kconfig
Expand Up @@ -88,6 +88,7 @@ config ZEN_INTERACTIVE

Mem dirty before bg writeback..: 10 % -> 20 %
Mem dirty before sync writeback: 20 % -> 50 %
Compact unevictable pages......: yes -> no

config BROKEN
bool
Expand Down
4 changes: 4 additions & 0 deletions mm/compaction.c
Expand Up @@ -1590,7 +1590,11 @@ typedef enum {
* Allow userspace to control policy on scanning the unevictable LRU for
* compactable pages.
*/
#ifdef CONFIG_ZEN_INTERACTIVE
int sysctl_compact_unevictable_allowed __read_mostly = 0;
#else
int sysctl_compact_unevictable_allowed __read_mostly = 1;
#endif

static inline void
update_fast_start_pfn(struct compact_control *cc, unsigned long pfn)
Expand Down

0 comments on commit 394ae0c

Please sign in to comment.