Here is another try at providing feedback to tune the vm_swappiness. This patch tries to tune it dynamically according to the mapped_ratio. After some consideration I thought it would be easiest to simply remove the vm_swappiness tunable entirely, since that is the point of this patch. Some in the field modelling and testing showed a biased downwards feedback based on the mapped ratio provided good performance under different workloads especially improving the desktop experience. The practical upshot of this is the machine will only ever swap very lightly while the percentage of mapped pages is low and allow more generous swapping as the percentage rises within the higher ranges. The earlier design of this patch was much more complicated and the practical upshot of it was that it would make vm_swappiness = mapped_ratio * mapped_ratio / 100 This had it's effect on the swappiness value in the setting of swap_tendency which was: swap_tendency = mapped_ratio / 2 + distress + vm_swappiness A close approximation was to make vm_swappiness a range of 0-150 instead of 100 and simplify swap tendency to be equal to this: swap_tendency = distress + vm_swappiness A follow up patch will use the vm_swappiness value to alter the rate of page inactivation as well, but for the moment I'll offer this one change for comments. Patch applies to 2.6.7-mm6 Signed-off-by: Con Kolivas include/linux/swap.h | 1 - include/linux/sysctl.h | 15 +++++++-------- kernel/sysctl.c | 11 ----------- mm/vmscan.c | 15 ++++++++------- 4 files changed, 15 insertions(+), 27 deletions(-)