[lkml]   [2012]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH 27/34] vmscan: activate executable pages after first usage
    From: Konstantin Khlebnikov <>

    commit c909e99364c8b6ca07864d752950b6b4ecf6bef4 upstream.

    Stable note: Not tracked in Bugzilla. There were reports of shared
    mapped pages being unfairly reclaimed in comparison to older kernels.
    This is being addressed over time.

    Logic added in commit 8cab4754d24a0 ("vmscan: make mapped executable pages
    the first class citizen") was noticeably weakened in commit
    645747462435d84 ("vmscan: detect mapped file pages used only once").

    Currently these pages can become "first class citizens" only after second
    usage. After this patch page_check_references() will activate they after
    first usage, and executable code gets yet better chance to stay in memory.

    Signed-off-by: Konstantin Khlebnikov <>
    Cc: Pekka Enberg <>
    Cc: Minchan Kim <>
    Cc: KAMEZAWA Hiroyuki <>
    Cc: Wu Fengguang <>
    Cc: Johannes Weiner <>
    Cc: Nick Piggin <>
    Cc: Shaohua Li <>
    Cc: Rik van Riel <>
    Signed-off-by: Andrew Morton <>
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Mel Gorman <>
    mm/vmscan.c | 6 ++++++
    1 file changed, 6 insertions(+)

    diff --git a/mm/vmscan.c b/mm/vmscan.c
    index 7edaaac..8b98a75 100644
    --- a/mm/vmscan.c
    +++ b/mm/vmscan.c
    @@ -726,6 +726,12 @@ static enum page_references page_check_references(struct page *page,
    if (referenced_page || referenced_ptes > 1)

    + /*
    + * Activate file-backed executable pages after first usage.
    + */
    + if (vm_flags & VM_EXEC)
    + return PAGEREF_ACTIVATE;
    return PAGEREF_KEEP;


     \ /
      Last update: 2012-07-23 16:21    [W:0.022 / U:10.532 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site