Re: [PATCH RFC v2 3/4] memcg: rework usage of stats by soft limit

From: Kirill A. Shutemov
Date: Sat Dec 12 2009 - 08:07:16 EST


On Sat, Dec 12, 2009 at 5:50 AM, Daisuke Nishimura
<d-nishimura@xxxxxxxxxxxxxxxxx> wrote:
> Sorry, I disagree this change.
>
> mem_cgroup_soft_limit_check() is used for checking how much current usage exceeds
> the soft_limit_in_bytes and updating softlimit tree asynchronously, instead of
> checking every charge/uncharge. What if you change the soft_limit_in_bytes,
> but the number of charges and uncharges are very balanced afterwards ?
> The softlimit tree will not be updated for a long time.

I don't see how my patch affects the logic you've described.
Statistics updates and
checks in the same place. It just uses decrement instead of increment.

>
> And IIUC, it's the same for your threshold feature, right ?
> I think it would be better:
>
> - discard this change.
> - in 4/4, rename mem_cgroup_soft_limit_check to mem_cgroup_event_check,
> Âand instead of adding a new STAT counter, do like:
>
> Â Â Â Âif (mem_cgroup_event_check(mem)) {
> Â Â Â Â Â Â Â Âmem_cgroup_update_tree(mem, page);
> Â Â Â Â Â Â Â Âmem_cgroup_threshold(mem);
> Â Â Â Â}

I think that mem_cgroup_update_tree() and mem_cgroup_threshold() should be
run with different frequency. How to share MEM_CGROUP_STAT_EVENTS
between soft limits and thresholds in this case?
--
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/