Skip to content

Commit

Permalink
vmscan: Reduce swapping aggressiveness to 10
Browse files Browse the repository at this point in the history
Since Android 12, memory management on Androids has been affected
significantly, especially on devices with <=4GB RAMs.

Multitasking on default settings was a horror and introducing custom Low
Memory Killers like SLMK did no much improvements.

Introduction of MGLRU seems to have relaxed this situation and now apps
don't get killed randomly. Instead, they get swapped to zRAM aggressively.

In such situation, reducing swappiness parameter seems to have helped alot
in multitasking and it seems fluid now.

Test: on normal usage, keep 5-6 apps and use them in repeat.
Outcome: none of them gets killed or swapped on in a short epoch, while 60%
still stays in memory after 7 hours idling.

Signed-off-by: Panchajanya1999 <[email protected]>
Signed-off-by: txexcalibur <[email protected]>
  • Loading branch information
Panchajanya1999 authored and txexcalibur committed Jul 18, 2024
1 parent d6be9c9 commit d12e2a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1702,7 +1702,7 @@ static struct ctl_table vm_table[] = {
.procname = "swappiness",
.data = &vm_swappiness,
.maxlen = sizeof(vm_swappiness),
.mode = 0644,
.mode = 0444,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
#ifdef CONFIG_INCREASE_MAXIMUM_SWAPPINESS
Expand Down
2 changes: 1 addition & 1 deletion mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ struct scan_control {
/*
* From 0 .. 100. Higher means more swappy.
*/
int vm_swappiness = 60;
int vm_swappiness = 10;
/*
* The total number of pages which are beyond the high watermark within all
* zones.
Expand Down

0 comments on commit d12e2a4

Please sign in to comment.