Re: [PATCH 2/2] oom: rework dump_tasks to optimize memcg-oom situation

From: Sha Zhengju
Date: Thu Nov 08 2012 - 08:58:38 EST


On 11/08/2012 06:34 AM, Michal Hocko wrote:
On Wed 07-11-12 16:41:59, Sha Zhengju wrote:
From: Sha Zhengju<handai.szj@xxxxxxxxxx>

If memcg oom happening, don't scan all system tasks to dump memory state of
eligible tasks, instead we iterates only over the process attached to the oom
memcg and avoid the rcu lock.
you have replaced rcu lock by css_set_lock which is, well, heavier than
rcu. Besides that the patch is not correct because you have excluded
all tasks that are from subgroups because you iterate only through the
top level one.
I am not sure the whole optimization would be a win even if implemented
correctly. Well, we scan through more tasks currently and most of them
are not relevant but then you would need to exclude task_in_mem_cgroup
from oom_unkillable_task and that would be more code churn than the
win.

Thanks for your and David's advice.
This piece is trying to save some expense while dumping memcg tasks, but failed to
scanning subgroups by iterating the cgroup. I'm agreed with your cost&win
opinion, so I decide to give up this one. : )


Thanks,
Sha

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