Re: [PATCH 4/3] memcg: call uncharge_swapcache outside of tree_lock(Re: [PATCH 0/3] fix stale swap cache account leak in memcg v7)

From: Daisuke Nishimura
Date: Tue May 12 2009 - 04:03:56 EST


> I understand the problem, but, wait a bit. NACK to this patch itself.
>
> 1. I placed _uncharge_ inside tree_lock because __remove_from_page_cache() does.
> (i.e. using the same logic.)
> So, plz change both logic at once.(change caller of mem_cgroup_uncharge_cache_page())
>
hmm, I see.
cache_charge is outside of tree_lock, so moving uncharge would make sense.
IMHO, we should make the period of spinlock as small as possible,
and charge/uncharge of pagecache/swapcache is protected by page lock, not tree_lock.

> 2. Shouldn't we disable IRQ while __mem_cgroup_uncharge_common() rather than moving
> function ?
>
Yes, this is another choise.
But, isn't it better to disable IRQ at all users of lock_page_cgroup..unlock_page_cgroup
to avoid this dead lock ?

Anyway, I'll postpone this fix for a while.
We should fix stale swap swapcache first.


Thanks,
Daisuke Nishimura.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/