[RFC PATCH 0/2] Add disable_unmap_file arg to memory.reclaim

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch proposes augmenting the memory.reclaim interface with a
disable_unmap_file argument that will skip the mapped pages in
that reclaim attempt.

For example:

echo "2M disable_unmap_file" > /sys/fs/cgroup/test/memory.reclaim

will perform reclaim on the test cgroup with no mapped file page.

The memory.reclaim is a useful interface. We can carry out proactive
memory reclaim in the user space, which can increase the utilization
rate of memory. 

In the actual usage scenarios, we found that when there are sufficient
anonymous pages, mapped file pages with a relatively small proportion
would still be reclaimed. This is likely to cause an increase in
refaults and an increase in task delay, because mapped file pages
usually include important executable codes, data, and shared libraries,
etc. According to the verified situation, if we can skip this part of
the memory, the task delay will be reduced.

IMO,it is difficult to balance the priorities of various pages in the
kernel, there are too many scenarios to consider. However, for the
scenario of proactive memory reclaim in user space, we can make a
simple judgment in this case.

Zhongkun He (2):
  mm: vmscan: modify the semantics of scan_control.may_unmap to
    UNMAP_ANON and UNMAP_FILE
  mm: memcg: add disbale_unmap_file arg to memory.reclaim

 include/linux/swap.h |  1 +
 mm/memcontrol.c      |  9 ++++--
 mm/vmscan.c          | 65 ++++++++++++++++++++++++++++++++++----------
 3 files changed, 59 insertions(+), 16 deletions(-)

-- 
2.20.1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux