Re: [PATCH 4/4] memcg: fix swap accounting

Balbir Singh
2009-05-30T07:20:42Z

* KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-05-28 14:21:56]:

> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>
> This patch fixes mis-accounting of swap usage in memcg.
>
> In current implementation, memcg's swap account is uncharged only when
> swap is completely freed. But there are several cases where swap
> cannot be freed cleanly. For handling that, this patch changes that
> memcg uncharges swap account when swap has no references other than cache.
>
> By this, memcg's swap entry accounting can be fully synchronous with
> the application's behavior.
> This patch also changes memcg's hooks for swap-out.
>

Looks good, so for count == 0, we directly free the and uncharge, for
the others we use retry_to_use_swap(). cool!

Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>

--
Balbir