[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0806290117510.21758@blonde.site>
Date: Sun, 29 Jun 2008 01:20:13 +0100 (BST)
From: Hugh Dickins <hugh@...itas.com>
To: Andrew Morton <akpm@...ux-foundation.org>
cc: Rik van Riel <riel@...hat.com>,
Lee Schermerhorn <lee.schermerhorn@...com>,
linux-kernel@...r.kernel.org
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@...itas.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))
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists