mem_cgroup_lru_del_before_commit_swapcache() seems broken
Hi, Kame,
mem_cgroup_lru_del_before_commit_swapcache() seems to be broken, here is why
static void mem_cgroup_lru_del_before_commit_swapcache(struct page *page)
{
unsigned long flags;
struct zone *zone = page_zone(page);
struct page_cgroup *pc = lookup_page_cgroup(page);
spin_lock_irqsave(&zone->lru_lock, flags);
/*
* Forget old LRU when this page_cgroup is *not* used. This
* Used bit
* is guarded by lock_page() because the page is SwapCache.
*/
if (!PageCgroupUsed(pc))
mem_cgroup_del_lru_list(page, page_lru(page));...
...
void mem_cgroup_del_lru_list(struct page *page, enum lru_list lru)
{
struct page_cgroup *pc;
struct mem_cgroup *mem;
struct mem_cgroup_per_zone *mz;
if (mem_cgroup_disabled())
return;
pc = lookup_page_cgroup(page);
/* can happen while we handle swapcache. */
if (!PageCgroupUsed(pc))
return;In mem_cgroup_lru_del_before_commit_swapcache() we say
if (!PageCgroupused(pc))
mem_cgroup_del_lru_list()
in mem_cgroup_del_lru_list() we say
if (!PageCgroupUsed(pc))
return;So why call mem_cgroup_del_lru_list() at all? Am I missing something.
Signature · 7 lines
Balbir -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 42 lines · Balbir Singh
Hi, Kame,
mem_cgroup_lru_del_before_commit_swapcache()seems to be broken, here is whystatic void
mem_cgroup_lru_del_before_commit_swapcache(struct page *page){ unsigned long flags; struct zone *zone = page_zone(page); struct page_cgroup *pc = lookup_page_cgroup(page); spin_lock_irqsave(&zone->lru_lock, flags); /* * Forget old LRU when this page_cgroup is *not* used. This * Used bit * is guarded by lock_page() because the page is SwapCache. */ if (!PageCgroupUsed(pc)) mem_cgroup_del_lru_list(page, page_lru(page));...
...
voidmem_cgroup_del_lru_list(struct page *page, enum lru_list lru){ struct page_cgroup *pc; struct mem_cgroup *mem; struct mem_cgroup_per_zone *mz; if (mem_cgroup_disabled()) return; pc = lookup_page_cgroup(page); /* can happen while we handle swapcache. */ if (!PageCgroupUsed(pc)) return;In
mem_cgroup_lru_del_before_commit_swapcache()we say
if (!PageCgroupused(pc))
mem_cgroup_del_lru_list()
Quoted 6 lines
in
mem_cgroup_del_lru_list()we sayif (!PageCgroupUsed(pc)) return;So why call
mem_cgroup_del_lru_list()at all? Am I missing something.
Please ignore, looks like a badly applied diff, let the change over in my sources. Sorry for the noise
Signature · 7 lines
Balbir -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>