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

From: Balbir Singh
Date: Sat May 30 2009 - 03:20:48 EST


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

> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
>
> 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@xxxxxxxxxxxxxxxxxx>


--
Balbir
--
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/