linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH 0/3] fix memcg to do swap account in right way (avoid swap account leak)
@ 2009-05-22  7:57 KAMEZAWA Hiroyuki
  2009-05-22  8:01 ` [RFC][PATCH 1/3] add SWAP_HAS_CACHE flag to swapmap KAMEZAWA Hiroyuki
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: KAMEZAWA Hiroyuki @ 2009-05-22  7:57 UTC (permalink / raw)
  To: linux-mm; +Cc: nishimura, balbir, hugh.dickins, akpm, hannes

Thank you all for comments to previous patches. This is new one.
(Please see when you have free time, I don't want to annoy anyone ;)

Major difference of this version to old ones is
 - old ones tries to fix swap handling itself...
 - this one tries to fix memcg's swap accounting.

I like ideas in this patch set. (But I may need more tests.)

Major concept of this patch set for fixing mis-accounting of memcg is
"ignore a ref from swapcache when we uncharge swap."

Consists of following 3 patches. Maybe patch 1/3 can be a concern for people who
don't use memcg.

 [1/3] Adding SWAP_HAS_CACHE flag to swap_map[] array.
 Add an flag to indicate "there is swap cache" instead of "refcnt from swapcache"
 By this, we'll be able to know refcnt to swap without find_get_page(swapper_space).

 [2/3] fix memcg to handle refcnt to swap.
 There is an issue that "all swap references gone but it can't be freed/uncharged
 because its swapcache is not on memcg's LRU".
 To fix this, this patch tries to unaccount swap even if there is swap-cache.
 Need careful tests (and some fix) but I think this is a good way to go.

 This patch uncharge swap account but swp_entry is still used by swap-cache.
 So, some more work to reclaim unnecesary swap-cache will be required (at vm_swap_full())

 [3/3] count # of swap caches with "unused swp_entries".
 This patch just counts # of swap caches whose swp_entry has no reference.
 This counter + vm_swap_full() will allow us to write a function to reclaim
 swp_entry which is unused.

Any comments are welcome.

Thanks,
-Kame

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2009-05-22  8:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-22  7:57 [RFC][PATCH 0/3] fix memcg to do swap account in right way (avoid swap account leak) KAMEZAWA Hiroyuki
2009-05-22  8:01 ` [RFC][PATCH 1/3] add SWAP_HAS_CACHE flag to swapmap KAMEZAWA Hiroyuki
2009-05-22  8:04 ` [RFC][PATCH 2/3] fix memcg swap account to handle swap ref itself KAMEZAWA Hiroyuki
2009-05-22  8:05 ` [RFC][PATCH 3/3] count swap caches whose swp_entry can be freed KAMEZAWA Hiroyuki

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