diff options
author | Vinayak Menon <vinmenon@codeaurora.org> | 2015-12-21 13:00:58 +0530 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 21:19:04 -0700 |
commit | ad6f4862845c0d6462a9ad7ba2d2e67132449eb1 (patch) | |
tree | 8e86c13fc0d0e0a5badda10a4012123795ad4394 /kernel/sysctl.c | |
parent | 1506b57673ab9393f54d584c9a1144f5152fa18f (diff) |
mm: swap: swap ratio support
Add support to receive a static ratio from userspace to
divide the swap pages between ZRAM and disk based swap
devices. The existing infrastructure allows to keep
same priority for multiple swap devices, which results
in round robin distribution of pages. With this patch,
the ratio can be defined.
CRs-fixed: 968416
Change-Id: I54f54489db84cabb206569dd62d61a8a7a898991
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index f657173f5c15..dcb852652bc8 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1827,6 +1827,22 @@ static struct ctl_table vm_table[] = { .extra2 = (void *)&mmap_rnd_compat_bits_max, }, #endif +#ifdef CONFIG_SWAP + { + .procname = "swap_ratio", + .data = &sysctl_swap_ratio, + .maxlen = sizeof(sysctl_swap_ratio), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + }, + { + .procname = "swap_ratio_enable", + .data = &sysctl_swap_ratio_enable, + .maxlen = sizeof(sysctl_swap_ratio_enable), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + }, +#endif { } }; |