lkml.org 
[lkml]   [2008]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] splitlru: shmem_getpage SetPageSwapBacked sooner
    shmem_getpage must SetPageSwapBacked before the mem_cgroup_cache_charge,
    otherwise try_to_free_mem_cgroup_pages cannot find the shmem/tmpfs pages
    it needs to free, and OOMs result.

    Signed-off-by: Hugh Dickins <hugh@veritas.com>
    ---
    Should follow mmotm's define-page_file_cache-function.patch

    mm/shmem.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- mmotm/mm/shmem.c 2008-06-27 13:39:20.000000000 +0100
    +++ linux/mm/shmem.c 2008-06-27 17:25:41.000000000 +0100
    @@ -1369,6 +1369,7 @@ repeat:
    error = -ENOMEM;
    goto failed;
    }
    + SetPageSwapBacked(filepage);

    /* Precharge page while we can wait, compensate after */
    error = mem_cgroup_cache_charge(filepage, current->mm,
    @@ -1381,7 +1382,6 @@ repeat:
    goto failed;
    }

    - SetPageSwapBacked(filepage);
    spin_lock(&info->lock);
    entry = shmem_swp_alloc(info, idx, sgp);
    if (IS_ERR(entry))

    \
     
     \ /
      Last update: 2008-06-29 02:23    [W:0.026 / U:1.456 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site