Commit graph

4 commits

Author SHA1 Message Date
Rishabh Bhatnagar
e9a05bb4d3 spdx: Modify spdx tag from GPL-2.0 to GPL-2.0-only
Modify spdx tag for all CAF authored files for Kona.

Change-Id: I9308c7189412b1e428a7f67ded0dc076b0e38254
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
2018-12-10 11:09:45 -08:00
Vinayak Menon
cfe6283c0f mm: swap_ratio: consider swap slots
Newer kernels allocate swap slots in batches to reduce
the contention on swap info lock. This results in the
max write values defined by swap ratio for fast and
slow swap devices multiply by batch size. This causes
the longer writes to one particular swap device failing
the swap ratio feature.

Change-Id: I9bb927b235fbf5b6f8b40bcdeb406ae6c48d9fb0
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2018-11-05 20:44:56 -08:00
Vinayak Menon
6255776128 mm: swap_ratio: bail out if there aren't any other swap device
It is pointless to calculate the swap ratio when there is only
one swap device in the group. Moreover the existing code would
result in a spinlock recursion because of not taking this into
consideration. Interestingly, this check is already performed
in swap_ratio_slow by this piece of code

if (&(*si)->avail_list == plist_last(&swap_avail_head)) {
	/* just to make skip work */
	n = *si;
	ret = -ENODEV;
	goto skip;
}

But there is window where we drop the swap_avail_lock before
invoking swap_ratio() and take it back again in swap_ratio_slow.
In this period the si can get removed from swap_avail_head,
resulting in the failure of above logic. So recheck again.

Similarly, bail out from swap_ratio() if the sysctl is disabled,
and thus avoiding overhead of taking unnecessary locks.

Change-Id: I81a9dd61d24b7da55d5341c48a1f71d2b4b1978d
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Signed-off-by: Swathi Sridhar <swatsrid@codeaurora.org>
2018-11-05 20:44:55 -08:00
Vinayak Menon
ac4b2c42c8 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.

Change-Id: I54f54489db84cabb206569dd62d61a8a7a898991
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
[swatsrid@codeaurora.org: Fix trivial merge conflicts]
Signed-off-by: Swathi Sridhar <swatsrid@codeaurora.org>
2018-10-16 10:35:44 -07:00