• Ken Chen's avatar
    [PATCH] do not disturb page referenced state when unmapping memory range · daa88c8d
    Ken Chen authored
    When kernel unmaps an address range, it needs to transfer PTE state into
    page struct.  Currently, kernel transfer access bit via
    mark_page_accessed().  The call to mark_page_accessed in the unmap path
    doesn't look logically correct.
    
    At unmap time, calling mark_page_accessed will causes page LRU state to be
    bumped up one step closer to more recently used state.  It is causing quite
    a bit headache in a scenario when a process creates a shmem segment, touch
    a whole bunch of pages, then unmaps it.  The unmapping takes a long time
    because mark_page_accessed() will start moving pages from inactive to
    active list.
    
    I'm not too much concerned with moving the page from one list to another in
    LRU.  Sooner or later it might be moved because of multiple mappings from
    various processes.  But it just doesn't look logical that when user asks a
    range to be unmapped, it's his intention that the process is no longer
    interested in these pages.  Moving those pages to active list (or bumping
    up a state towards more active) seems to be an over reaction.  It also
    prolongs unmapping latency which is the core issue I'm trying to solve.
    
    As suggested by Peter, we should still preserve the info on pte young
    pages, but not more.
    Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
    Acked-by: default avatarKen Chen <kenchen@google.com>
    Cc: Hugh Dickins <hugh@veritas.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    daa88c8d
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
allocpercpu.c Loading commit data...
backing-dev.c Loading commit data...
bootmem.c Loading commit data...
bounce.c Loading commit data...
fadvise.c Loading commit data...
filemap.c Loading commit data...
filemap.h Loading commit data...
filemap_xip.c Loading commit data...
fremap.c Loading commit data...
highmem.c Loading commit data...
hugetlb.c Loading commit data...
internal.h Loading commit data...
madvise.c Loading commit data...
memory.c Loading commit data...
memory_hotplug.c Loading commit data...
mempolicy.c Loading commit data...
mempool.c Loading commit data...
migrate.c Loading commit data...
mincore.c Loading commit data...
mlock.c Loading commit data...
mmap.c Loading commit data...
mmzone.c Loading commit data...
mprotect.c Loading commit data...
mremap.c Loading commit data...
msync.c Loading commit data...
nommu.c Loading commit data...
oom_kill.c Loading commit data...
page-writeback.c Loading commit data...
page_alloc.c Loading commit data...
page_io.c Loading commit data...
pdflush.c Loading commit data...
prio_tree.c Loading commit data...
readahead.c Loading commit data...
rmap.c Loading commit data...
shmem.c Loading commit data...
shmem_acl.c Loading commit data...
slab.c Loading commit data...
slob.c Loading commit data...
sparse.c Loading commit data...
swap.c Loading commit data...
swap_state.c Loading commit data...
swapfile.c Loading commit data...
thrash.c Loading commit data...
tiny-shmem.c Loading commit data...
truncate.c Loading commit data...
util.c Loading commit data...
vmalloc.c Loading commit data...
vmscan.c Loading commit data...
vmstat.c Loading commit data...