Re: [PATCH] memcg: shmem_getpage release page sooner

From: KAMEZAWA Hiroyuki
Date: Sun Jun 29 2008 - 22:22:56 EST


On Sun, 29 Jun 2008 01:14:30 +0100 (BST)
Hugh Dickins <hugh@xxxxxxxxxxx> wrote:

> No big deal, but since mem_cgroup_shrink_usage doesn't require a page to
> operate upon, page_cache_release the swappage before calling it, so it's
> not pinned across the reclaim.
>
> Signed-off-by: Hugh Dickins <hugh@xxxxxxxxxxx>

this one is better, thanks.

Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>

> ---
> Should follow mmotm's memcg-helper-function-for-relcaim-from-shmem.patch
>
> mm/shmem.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> --- mmotm/mm/shmem.c 2008-06-27 13:39:20.000000000 +0100
> +++ linux/mm/shmem.c 2008-06-27 17:25:41.000000000 +0100
> @@ -1315,16 +1315,14 @@ repeat:
> shmem_swp_unmap(entry);
> spin_unlock(&info->lock);
> unlock_page(swappage);
> + page_cache_release(swappage);
> if (error == -ENOMEM) {
> /* allow reclaim from this memory cgroup */
> error = mem_cgroup_shrink_usage(current->mm,
> - gfp & ~__GFP_HIGHMEM);
> - if (error) {
> - page_cache_release(swappage);
> + gfp);
> + if (error)
> goto failed;
> - }
> }
> - page_cache_release(swappage);
> goto repeat;
> }
> } else if (sgp == SGP_READ && !filepage) {
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/