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>
tirimbino
Vinayak Menon 7 years ago
parent e41ce2b892
commit 4dfafa67ea
  1. 5
      mm/swap_ratio.c

@ -17,8 +17,9 @@
#define SWAP_RATIO_GROUP_START (SWAP_FLAG_PRIO_MASK - 9) /* 32758 */
#define SWAP_RATIO_GROUP_END (SWAP_FLAG_PRIO_MASK) /* 32767 */
#define SWAP_FAST_WRITES (SWAPFILE_CLUSTER * (SWAP_CLUSTER_MAX / 8))
#define SWAP_SLOW_WRITES SWAPFILE_CLUSTER
#define SWAP_FAST_WRITES \
((SWAPFILE_CLUSTER * (SWAP_CLUSTER_MAX / 8)) / SWAP_BATCH)
#define SWAP_SLOW_WRITES (SWAPFILE_CLUSTER / SWAP_BATCH)
/*
* The fast/slow swap write ratio.

Loading…
Cancel
Save