Re: [PATCH 6/9] ksm: mem cgroup charge swapin copy

From: Balbir Singh
Date: Wed Nov 25 2009 - 09:24:10 EST


* Hugh Dickins <hugh.dickins@xxxxxxxxxxxxx> [2009-11-24 16:51:13]:

> But ksm swapping does require one small change in mem cgroup handling.
> When do_swap_page()'s call to ksm_might_need_to_copy() does indeed
> substitute a duplicate page to accommodate a different anon_vma (or a
> different index), that page escaped mem cgroup accounting, because of
> the !PageSwapCache check in mem_cgroup_try_charge_swapin().
>

The duplicate page doesn't show up as PageSwapCache or are we optimizing
for the race condition where the page is not in SwapCache? I should
probably look at the full series.

> That was returning success without charging, on the assumption that
> pte_same() would fail after, which is not the case here. Originally I
> proposed that success, so that an unshrinkable mem cgroup at its limit
> would not fail unnecessarily; but that's a minor point, and there are
> plenty of other places where we may fail an overallocation which might
> later prove unnecessary. So just go ahead and do what all the other
> exceptions do: proceed to charge current mm.
>
> Signed-off-by: Hugh Dickins <hugh.dickins@xxxxxxxxxxxxx>


Thanks for the patch!
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/