From: Michal Hocko <mhocko@suse.cz>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org
Subject: Re: [PATCH] memcg: change oom_info_lock to mutex
Date: Tue, 11 Feb 2014 11:22:38 +0100 [thread overview]
Message-ID: <20140211102238.GB11946@dhcp22.suse.cz> (raw)
In-Reply-To: <alpine.DEB.2.02.1402101339580.15624@chino.kir.corp.google.com>
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, 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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2014-02-11 10:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-10 13:48 Michal Hocko
2014-02-10 21:40 ` David Rientjes
2014-02-11 10:22 ` Michal Hocko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140211102238.GB11946@dhcp22.suse.cz \
--to=mhocko@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox