Re: [PATCH] mm: memcontrol: zap oom_info_lock
From: Michal Hocko
Date: Fri Mar 11 2016 - 05:29:37 EST
On Fri 11-03-16 13:11:23, Vladimir Davydov wrote:
> mem_cgroup_print_oom_info is always called under oom_lock, so
> oom_info_lock is redundant.
>
> Signed-off-by: Vladimir Davydov <vdavydov@xxxxxxxxxxxxx>
Acked-by: Michal Hocko <mhocko@xxxxxxxx>
> ---
> mm/memcontrol.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index fa7bf354ae32..36db05fa8acb 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1150,12 +1150,9 @@ static bool mem_cgroup_wait_acct_move(struct mem_cgroup *memcg)
> */
> void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
> {
> - /* oom_info_lock ensures that parallel ooms do not interleave */
> - static DEFINE_MUTEX(oom_info_lock);
> struct mem_cgroup *iter;
> unsigned int i;
>
> - mutex_lock(&oom_info_lock);
> rcu_read_lock();
>
> if (p) {
> @@ -1199,7 +1196,6 @@ void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
>
> pr_cont("\n");
> }
> - mutex_unlock(&oom_info_lock);
> }
>
> /*
> --
> 2.1.4
--
Michal Hocko
SUSE Labs