mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] splitlru: shmem_getpage SetPageSwapBacked sooner
@ 2008-06-29  0:20 Hugh Dickins
  2008-06-29  0:22 ` [PATCH] splitlru: memcg swapbacked pages active Hugh Dickins
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Hugh Dickins @ 2008-06-29  0:20 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Rik van Riel, Lee Schermerhorn, linux-kernel

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))

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2008-07-03  8:32 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-29  0:20 [PATCH] splitlru: shmem_getpage SetPageSwapBacked sooner Hugh Dickins
2008-06-29  0:22 ` [PATCH] splitlru: memcg swapbacked pages active Hugh Dickins
2008-06-29  8:19   ` KOSAKI Motohiro
2008-06-29 12:20     ` Hugh Dickins
2008-06-29 12:58       ` KOSAKI Motohiro
2008-06-29 13:51         ` Hugh Dickins
2008-06-30  2:44   ` KAMEZAWA Hiroyuki
2008-06-30 19:19     ` Hugh Dickins
2008-06-30  8:36   ` [RFC][PATCH] memcg: change shmem handler KAMEZAWA Hiroyuki
2008-06-30 19:52     ` Hugh Dickins
2008-07-01  0:56     ` kamezawa.hiroyu
2008-07-02  2:16       ` [RFC][PATCH] memcg: shmem swap cache KAMEZAWA Hiroyuki
2008-07-01  1:06     ` Re: Re: [RFC][PATCH] memcg: change shmem handler kamezawa.hiroyu
2008-07-03  7:15     ` Balbir Singh
2008-07-03  7:56       ` KAMEZAWA Hiroyuki
2008-06-29  0:24 ` [PATCH] splitlru: BDI_CAP_SWAP_BACKED Hugh Dickins
2008-06-29  8:48   ` KOSAKI Motohiro
2008-06-29 15:16     ` Rik van Riel
2008-06-30  2:53     ` KAMEZAWA Hiroyuki
2008-06-30 19:23       ` Hugh Dickins
2008-06-30 19:49         ` Rik van Riel
2008-06-30 20:55           ` Hugh Dickins
2008-06-30 21:17             ` Rik van Riel
2008-06-29  8:09 ` [PATCH] splitlru: shmem_getpage SetPageSwapBacked sooner KOSAKI Motohiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®