lkml.org 
[lkml]   [2008]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [BUGFIX][PATCH mmotm] memcg fix swap accounting leak (v3)
On Mon, 15 Dec 2008, KAMEZAWA Hiroyuki wrote:
>
> Fix swapin charge operation of memcg.
>
> @@ -1139,10 +1139,11 @@ void mem_cgroup_commit_charge_swapin(str
> /*
> * Now swap is on-memory. This means this page may be
> * counted both as mem and swap....double count.
> - * Fix it by uncharging from memsw. This SwapCache is stable
> - * because we're still under lock_page().
> + * Fix it by uncharging from memsw. Basically, this SwapCache is stable
> + * under lock_page(). But in do_swap_page()::memory.c, reuse_swap_page()
> + * may call delete_from_swap_cache() before reach here.
> */
> - if (do_swap_account) {
> + if (do_swap_account && PageSwapCache(page)) {
> swp_entry_t ent = {.val = page_private(page)};
> struct mem_cgroup *memcg;
> memcg = swap_cgroup_record(ent, NULL);

Yes, that addition looks good to me.

Hugh


\
 
 \ /
  Last update: 2008-12-15 11:37    [W:0.052 / U:1.980 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site