• Ebru Akagunduz's avatar
    mm: make swapin readahead to improve thp collapse rate · 8a966ed7
    Ebru Akagunduz authored
    This patch makes swapin readahead to improve thp collapse rate.  When
    khugepaged scanned pages, there can be a few of the pages in swap area.
    
    With the patch THP can collapse 4kB pages into a THP when there are up
    to max_ptes_swap swap ptes in a 2MB range.
    
    The patch was tested with a test program that allocates 400B of memory,
    writes to it, and then sleeps.  I force the system to swap out all.
    Afterwards, the test program touches the area by writing, it skips a
    page in each 20 pages of the area.
    
    Without the patch, system did not swap in readahead.  THP rate was %65
    of the program of the memory, it did not change over time.
    
    With this patch, after 10 minutes of waiting khugepaged had collapsed
    %99 of the program's memory.
    
    [kirill.shutemov@linux.intel.com: trivial cleanup of exit path of the function]
    [kirill.shutemov@linux.intel.com: __collapse_huge_page_swapin(): drop unused 'pte' parameter]
    [kirill.shutemov@linux.intel.com: do not hold anon_vma lock during swap in]
    Signed-off-by: default avatarEbru Akagunduz <ebru.akagunduz@gmail.com>
    Acked-by: default avatarRik van Riel <riel@redhat.com>
    Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
    Cc: Andrea Arcangeli <aarcange@redhat.com>
    Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
    Cc: Xie XiuQi <xiexiuqi@huawei.com>
    Cc: Cyrill Gorcunov <gorcunov@openvz.org>
    Cc: Mel Gorman <mgorman@techsingularity.net>
    Cc: David Rientjes <rientjes@google.com>
    Cc: Vlastimil Babka <vbabka@suse.cz>
    Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Michal Hocko <mhocko@suse.cz>
    Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    8a966ed7
Name
Last commit
Last update
..
9p.h Loading commit data...
asoc.h Loading commit data...
bcache.h Loading commit data...
block.h Loading commit data...
btrfs.h Loading commit data...
clk.h Loading commit data...
cma.h Loading commit data...
compaction.h Loading commit data...
context_tracking.h Loading commit data...
cpuhp.h Loading commit data...
ext4.h Loading commit data...
f2fs.h Loading commit data...
fence.h Loading commit data...
fib.h Loading commit data...
fib6.h Loading commit data...
filelock.h Loading commit data...
filemap.h Loading commit data...
gpio.h Loading commit data...
host1x.h Loading commit data...
hswadsp.h Loading commit data...
huge_memory.h Loading commit data...
i2c.h Loading commit data...
intel-sst.h Loading commit data...
iommu.h Loading commit data...
ipi.h Loading commit data...
irq.h Loading commit data...
jbd2.h Loading commit data...
kmem.h Loading commit data...
kvm.h Loading commit data...
libata.h Loading commit data...
lock.h Loading commit data...
mce.h Loading commit data...
migrate.h Loading commit data...
mmc.h Loading commit data...
mmflags.h Loading commit data...
module.h Loading commit data...
napi.h Loading commit data...
net.h Loading commit data...
nilfs2.h Loading commit data...
nmi.h Loading commit data...
oom.h Loading commit data...
page_isolation.h Loading commit data...
page_ref.h Loading commit data...
pagemap.h Loading commit data...
power.h Loading commit data...
power_cpu_migrate.h Loading commit data...
printk.h Loading commit data...
random.h Loading commit data...
rcu.h Loading commit data...
regulator.h Loading commit data...
rpm.h Loading commit data...
sched.h Loading commit data...
scsi.h Loading commit data...
signal.h Loading commit data...
skb.h Loading commit data...
sock.h Loading commit data...
spi.h Loading commit data...
spmi.h Loading commit data...
sunrpc.h Loading commit data...
sunvnet.h Loading commit data...
swiotlb.h Loading commit data...
syscalls.h Loading commit data...
target.h Loading commit data...
task.h Loading commit data...
thermal.h Loading commit data...
thermal_power_allocator.h Loading commit data...
thp.h Loading commit data...
timer.h Loading commit data...
tlb.h Loading commit data...
udp.h Loading commit data...
v4l2.h Loading commit data...
vb2.h Loading commit data...
vmscan.h Loading commit data...
workqueue.h Loading commit data...
writeback.h Loading commit data...
xen.h Loading commit data...