linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Tejun Heo <tj@kernel.org>,
	linux-next@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: linux-next: manual merge of the akpm-current tree with the cgroup tree
Date: Fri, 14 Feb 2014 09:33:45 +0100	[thread overview]
Message-ID: <20140214083345.GA29814@dhcp22.suse.cz> (raw)
In-Reply-To: <20140214153414.b15e54bf5aa61d0e75bacc90@canb.auug.org.au>

On Fri 14-02-14 15:34:14, Stephen Rothwell wrote:
[...]
> diff --cc mm/memcontrol.c
> index d9c6ac1532e6,de1a2aed4954..000000000000
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@@ -1683,25 -1683,54 +1683,25 @@@ static void move_unlock_mem_cgroup(stru
>    */
>   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
>  -	 */
>  +	/* oom_info_lock ensures 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];
>  -	int ret;
>   	struct mem_cgroup *iter;
>   	unsigned int i;
>   
>   	if (!p)
>   		return;
>   
> - 	spin_lock(&oom_info_lock);
> + 	mutex_lock(&oom_info_lock);
>   	rcu_read_lock();
>   
>  -	mem_cgrp = memcg->css.cgroup;
>  -	task_cgrp = task_cgroup(p, mem_cgroup_subsys_id);
>  -
>  -	ret = cgroup_path(task_cgrp, memcg_name, PATH_MAX);
>  -	if (ret < 0) {
>  -		/*
>  -		 * Unfortunately, we are unable to convert to a useful name
>  -		 * But we'll still print out the usage information
>  -		 */
>  -		rcu_read_unlock();
>  -		goto done;
>  -	}
>  -	rcu_read_unlock();
>  -
>  -	pr_info("Task in %s killed", memcg_name);
>  +	pr_info("Task in ");
>  +	pr_cont_cgroup_path(task_cgroup(p, memory_cgrp_id));
>  +	pr_info(" killed as a result of limit of ");
>  +	pr_cont_cgroup_path(memcg->css.cgroup);
>  +	pr_info("\n");
>   
>  -	rcu_read_lock();
>  -	ret = cgroup_path(mem_cgrp, memcg_name, PATH_MAX);
>  -	if (ret < 0) {
>  -		rcu_read_unlock();
>  -		goto done;
>  -	}
>   	rcu_read_unlock();
>   
>  -	/*
>  -	 * Continues from above, so we don't need an KERN_ level
>  -	 */
>  -	pr_cont(" as a result of limit of %s\n", memcg_name);
>  -done:
>  -
>   	pr_info("memory: usage %llukB, limit %llukB, failcnt %llu\n",
>   		res_counter_read_u64(&memcg->res, RES_USAGE) >> 10,
>   		res_counter_read_u64(&memcg->res, RES_LIMIT) >> 10,

I do not see spin_unlock -> mutex_unlock at the very end of this function.


-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2014-02-14  8:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-14  4:34 linux-next: manual merge of the akpm-current tree with the cgroup tree Stephen Rothwell
2014-02-14  8:33 ` Michal Hocko [this message]
2014-02-14  8:57   ` Michal Hocko
  -- strict thread matches above, loose matches on Subject: below --
2015-08-19  8:43 Stephen Rothwell
2014-05-14  7:22 Stephen Rothwell
2014-02-26  7:43 Stephen Rothwell
2014-02-14  4:25 Stephen Rothwell
2014-02-14  4:30 ` Stephen Rothwell
2013-09-25  3:57 Stephen Rothwell
2013-08-12  6:07 Stephen Rothwell

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=20140214083345.GA29814@dhcp22.suse.cz \
    --to=mhocko@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=tj@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).