Re: [PATCH v10 30/35] memcg: scan cache objects hierarchically

Andrew Morton
2013-06-05T23:08:46Z

On Mon, 3 Jun 2013 23:29:59 +0400 Glauber Costa <glommer@openvz.org> wrote:

> When reaching shrink_slab, we should descent in children memcg searching

"descend into child memcgs"

> for objects that could be shrunk. This is true even if the memcg does

"can be"

> not have kmem limits on, since the kmem res_counter will also be billed
> against the user res_counter of the parent.
>
> It is possible that we will free objects and not free any pages, that
> will just harm the child groups without helping the parent group at all.
> But at this point, we basically are prepared to pay the price.
>
> ...
>
> #ifdef CONFIG_MEMCG_KMEM
> +bool memcg_kmem_should_reclaim(struct mem_cgroup *memcg)
> +{
> + struct mem_cgroup *iter;
> +
> + for_each_mem_cgroup_tree(iter, memcg) {
> + if (memcg_kmem_is_active(iter)) {
> + mem_cgroup_iter_break(memcg, iter);
> + return true;
> + }
> + }
> + return false;
> +}

Locking requirements for this function? Perhaps the
for_each_mem_cgroup_tree() definition site would be an appropriate
place to document this.

> static inline bool memcg_can_account_kmem(struct mem_cgroup *memcg)
> {
> return !mem_cgroup_disabled() && !mem_cgroup_is_root(memcg) &&
>
> ...
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: email@kvack.org