linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] memcg fix swap accounting (28/May)
@ 2009-05-28  4:54 KAMEZAWA Hiroyuki
  2009-05-28  5:10 ` [PATCH 1/4] add swap cache interface for swap reference KAMEZAWA Hiroyuki
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: KAMEZAWA Hiroyuki @ 2009-05-28  4:54 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel, nishimura, balbir, hugh.dickins, hannes, akpm

Removed "RFC"

This patch series is restructured as following. some bugs are fixed.
Thank you for all your helps.

[1/4] ....change interface of swap_duplicate()/swap_free()
    Adds an function swapcache_prepare() and swapcache_free().

[2/4] ....add SWAP_HAS_CACHE flag and modify reference counting in swap_map
    Add SWAP_HAS_CACHE flag to swap_map array for knowing an information that
    "there is an only swap cache and swap has no reference" 
    without extra call of find_get_page().

[3/4] ....reclaim swap-cache-only swap_entry when get_swap_page() find it.
    Now, swap_map can tell "there is no reference other than cache", we
    can reclaim it if necessary.
    This code reclaim swap entries if
    - vm_swap_full()==ture
    && there is no free swap cluster
    && get_swap_page() finds unused swap entry.

[4/4].... fix memcg's swap accounting
    This is for fixing memcg's swap account leak. like this
==
            processA                   |           processB
  -------------------------------------+-------------------------------------
    (free_swap_and_cache())            |  (read_swap_cache_async())
                                       |    swap_duplicate()
                                       |    __set_page_locked()
                                       |    add_to_swap_cache()
      swap_entry_free() == 0           |
      find_get_page() -> found         |
      try_lock_page() -> fail & return |
                                       |    lru_cache_add_anon()
                                       |      doesn't link this page to memcg's
                                       |      LRU, because of !PageCgroupUsed.
==
    This patch tries to fix this by uncharging account when swap's refcnt goes
    to 0 even if there is an unused swap-cache.

    Works quite well in my test.

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] 22+ messages in thread
* [PATCH 0/4] memcg fix swap accounting (2/Jun)
@ 2009-06-02  3:04 KAMEZAWA Hiroyuki
  2009-06-02  3:12 ` [PATCH 3/4] reuse unused swap entry if necessary KAMEZAWA Hiroyuki
  0 siblings, 1 reply; 22+ messages in thread
From: KAMEZAWA Hiroyuki @ 2009-06-02  3:04 UTC (permalink / raw)
  To: linux-mm; +Cc: akpm, balbir, nishimura, linux-kernel

This is an updated sereis of memcg fix swap accounting
 http://marc.info/?l=linux-mm&m=124348659700540&w=2

Now in mmotm as
 mm-add-swap-cache-interface-for-swap-reference.patch
 mm-modify-swap_map-and-add-swap_has_cache-flag.patch
 mm-reuse-unused-swap-entry-if-necessary.patch
 memcg-fix-swap-accounting.patch

No logic changes but fixed some condig style troubles pointed out.

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] 22+ messages in thread

end of thread, other threads:[~2009-06-04  7:01 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-28  4:54 [PATCH 0/4] memcg fix swap accounting (28/May) KAMEZAWA Hiroyuki
2009-05-28  5:10 ` [PATCH 1/4] add swap cache interface for swap reference KAMEZAWA Hiroyuki
2009-05-29  4:21   ` Daisuke Nishimura
2009-05-29  5:08     ` KAMEZAWA Hiroyuki
2009-05-29  5:37       ` [PATCH 1/4] add swap cache interface for swap reference v2 (updated) KAMEZAWA Hiroyuki
2009-05-29  6:05         ` Daisuke Nishimura
2009-05-29  6:53           ` KAMEZAWA Hiroyuki
2009-05-30  5:21         ` Balbir Singh
2009-05-28  5:19 ` [PATCH 2/4] modify swap_map and add SWAP_HAS_CACHE flag KAMEZAWA Hiroyuki
2009-05-30  6:10   ` Balbir Singh
2009-05-30 11:16     ` KAMEZAWA Hiroyuki
2009-05-30 11:35       ` Balbir Singh
2009-06-01  7:04   ` Daisuke Nishimura
2009-05-28  5:20 ` [PATCH 3/4] reuse unused swap entry if necessary KAMEZAWA Hiroyuki
2009-05-29 21:55   ` Andrew Morton
2009-05-30 11:11     ` KAMEZAWA Hiroyuki
2009-05-30  6:40   ` Balbir Singh
2009-05-28  5:21 ` [PATCH 4/4] memcg: fix swap accounting KAMEZAWA Hiroyuki
2009-05-30  7:20   ` Balbir Singh
2009-06-02  3:04 [PATCH 0/4] memcg fix swap accounting (2/Jun) KAMEZAWA Hiroyuki
2009-06-02  3:12 ` [PATCH 3/4] reuse unused swap entry if necessary KAMEZAWA Hiroyuki
2009-06-04  5:57   ` Daisuke Nishimura
2009-06-04  6:59     ` KAMEZAWA Hiroyuki

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