lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140211102238.GB11946@dhcp22.suse.cz>
Date:	Tue, 11 Feb 2014 11:22:38 +0100
From:	Michal Hocko <mhocko@...e.cz>
To:	David Rientjes <rientjes@...gle.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Johannes Weiner <hannes@...xchg.org>,
	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
	LKML <linux-kernel@...r.kernel.org>, linux-mm@...ck.org
Subject: Re: [PATCH] memcg: change oom_info_lock to mutex

On Mon 10-02-14 13:40:55, David Rientjes wrote:
> On Mon, 10 Feb 2014, Michal Hocko wrote:
> 
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index 19d5d4274e22..55e6731ebcd5 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -1687,7 +1687,7 @@ void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
> >  	 * protects memcg_name and makes sure that parallel ooms do not
> >  	 * interleave
> >  	 */
> > -	static DEFINE_SPINLOCK(oom_info_lock);
> > +	static DEFINE_MUTEX(oom_info_lock);
> >  	struct cgroup *task_cgrp;
> >  	struct cgroup *mem_cgrp;
> >  	static char memcg_name[PATH_MAX];
> > @@ -1698,7 +1698,7 @@ void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
> >  	if (!p)
> >  		return;
> >  
> > -	spin_lock(&oom_info_lock);
> > +	mutex_lock(&oom_info_lock);
> >  	rcu_read_lock();
> >  
> >  	mem_cgrp = memcg->css.cgroup;
> > @@ -1767,7 +1767,7 @@ done:
> >  
> >  		pr_cont("\n");
> >  	}
> > -	spin_unlock(&oom_info_lock);
> > +	mutex_unlock(&oom_info_lock);
> >  }
> >  
> >  /*
> 
> Can we change oom_info_lock() to only protecting memcg_name and forget 
> about interleaving the hierarchical memcg stats instead?

Why? Is mutex or holding it for the whole mem_cgroup_print_oom_info a
big deal? I think that having clear oom report is really worth it.

-- 
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ