Re: [PATCH] mm: add replace_page_cache_page() function

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: KAMEZAWA Hiroyuki
Date: Wednesday, December 15, 2010 - 6:07 pm

On Wed, 15 Dec 2010 16:49:58 +0100
Miklos Szeredi <miklos@szeredi.hu> wrote:


Hmm, then, the page will be recharged to "current" instead of the memcg
where "old" was under control. Is this design ? If so, why ?

In mm/migrate.c, following is called.

	 charge = mem_cgroup_prepare_migration(page, newpage, &mem);
	....do migration....
        if (!charge)
                mem_cgroup_end_migration(mem, page, newpage);

BTW, off topic, in fuse/dev.c

add_to_page_cache_locked(page)

is called and this page is "charged" to memory cgroup. But, IIUC, this page
will be never be on LRU and cannot be reclaimed by memory cgroup.
I think this looks like a memory leak at rmdir() of memory cgroup and
rmdir will fail wish -EBUSY always.

So, I'd like to change this call something like as

add_to_page_cache_locked_and_no_memory_cgroup_control().

So, I think just dropping this memory cgroup related code is okay for us
because this is a replacement for add_to_page_cache_locked() which seems
problematic.
This will put pages on fuse's private radix-tree out of control.

Or, is it possible to drain these radix-tree pages at rmdir() of memory
cgroup by some call ?

Thanks,
-Kame



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] mm: add replace_page_cache_page() function, Miklos Szeredi, (Wed Dec 15, 8:49 am)
Re: [PATCH] mm: add replace_page_cache_page() function, Rik van Riel, (Wed Dec 15, 9:49 am)
Re: [PATCH] mm: add replace_page_cache_page() function, Minchan Kim, (Wed Dec 15, 4:22 pm)
Re: [PATCH] mm: add replace_page_cache_page() function, KAMEZAWA Hiroyuki, (Wed Dec 15, 6:07 pm)
Re: [PATCH] mm: add replace_page_cache_page() function, Miklos Szeredi, (Thu Dec 16, 5:05 am)
Re: [PATCH] mm: add replace_page_cache_page() function, Hugh Dickins, (Thu Dec 16, 6:21 pm)
Re: [PATCH] mm: add replace_page_cache_page() function, Minchan Kim, (Thu Dec 16, 6:40 pm)
Re: [PATCH] mm: add replace_page_cache_page() function, Minchan Kim, (Thu Dec 16, 9:37 pm)
Re: [PATCH] mm: add replace_page_cache_page() function, Miklos Szeredi, (Fri Dec 17, 8:51 am)
Re: [PATCH] mm: add replace_page_cache_page() function, Miklos Szeredi, (Fri Dec 17, 8:53 am)
Re: [PATCH] mm: add replace_page_cache_page() function, KAMEZAWA Hiroyuki, (Sun Dec 19, 4:54 pm)