Re: [PATCH -mm -v6 2/9] mm, memcg: Support to charge/uncharge multiple swap entries

From: Huang\, Ying
Date: Wed Mar 08 2017 - 20:30:49 EST


Balbir Singh <bsingharora@xxxxxxxxx> writes:

> On Wed, 2017-03-08 at 15:26 +0800, Huang, Ying wrote:
>> From: Huang Ying <ying.huang@xxxxxxxxx>
>
>> This patch make it possible to charge or uncharge a set of continuous
>> swap entries in the swap cgroup.ÂÂThe number of swap entries is
>> specified via an added parameter.
>
>> This will be used for the THP (Transparent Huge Page) swap support.
>> Where a swap cluster backing a THP may be allocated and freed as a
>> whole.ÂÂSo a set of (HPAGE_PMD_NR) continuous swap entries backing one
>> THP need to be charged or uncharged together.ÂÂThis will batch the
>> cgroup operations for the THP swap too.
>
> A quick look at the patches makes it look sane. I wonder if we would
> make sense to track THP swapout separately as well
> (from a memory.stat perspective)

The patchset is just the first step of THP swap optimization. So the
THP will still be split after putting the THP into the swap cache. This
makes it unnecessary to change mem_cgroup_swapout(). I am working on a
following up patchset to further delaying THP splitting after swapping
out the THP to the disk. In that patchset, I will change
mem_cgroup_swapout() too.

Best Regards,
Huang, Ying

> Balbir Singh