swap: control swappiness dynamically 09/187509/4
authorByungSoo Kim <bs1770.kim@samsung.com>
Tue, 13 Jun 2017 05:31:25 +0000 (14:31 +0900)
committerPaweł Szewczyk <p.szewczyk@samsung.com>
Mon, 24 Sep 2018 12:58:34 +0000 (14:58 +0200)
commitfd683f9ff844891bda92a2cee7bec1958e38fccc
treede9f152d067d8b8e1c2750da730133b7b1ccf2e7
parente22487b003f6926a1aa63841cdfc3a16e5402387
swap: control swappiness dynamically

User space can control amount of swap by changing swappiness value.
Resourced swap can have basically two strategies.
- set default swappiness (60) before triggering force reclaim node.
  : Setting the value to the force reclaim node means to save memory as much as possilbe.
    But, if it has smaller swappiness value, there is no impact.
    Therefore, even though it has low swappiness value such as zero,
    use default swappiness value (60) before writing node and restore previous value after reclaiming.
- set minimum swappiness in case of swap full
  : If swap device is not enough space, trying to swap memory will be overhead.
    While resourced triggers early LMK, it should have minimum value.

Change-Id: If3ba566caf41a73bb22620b8e7f2403303a067be
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
src/common/memory-common.h
src/swap/swap.c