public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org>
To: Oleg Nesterov <oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org,
	mhocko-AlSwsSmVLrQ@public.gmane.org,
	bsingharora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
	vdavydov-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org,
	tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	handai.szj-3b8fjiQLQpfQT0dZR+AlfA@public.gmane.org,
	rientjes-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org,
	kirill.shutemov-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org
Subject: Re: [RFC][PATCH] oom: Be less verbose if the oom_control event fd has listeners
Date: Thu, 05 Jun 2014 17:46:57 +0200	[thread overview]
Message-ID: <539090F1.7090408@nod.at> (raw)
In-Reply-To: <20140605141841.GA23796-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Am 05.06.2014 16:18, schrieb Oleg Nesterov:
> On 06/05, Richard Weinberger wrote:
>>
>> +int mem_cgroup_has_listeners(struct mem_cgroup *memcg)
>> +{
>> +	int ret = 0;
>> +
>> +	if (!memcg)
>> +		goto out;
>> +
>> +	spin_lock(&memcg_oom_lock);
>> +	ret = !list_empty(&memcg->oom_notify);
>> +	spin_unlock(&memcg_oom_lock);
>> +
>> +out:
>> +	return ret;
>> +}
> 
> Do we really need memcg_oom_lock to check list_empty() ? With or without
> this lock we can race with list_add/del anyway, and I guess we do not care.

Hmm, in mm/memcontrol.c all list_dev/add are under memcg_oom_lock.
What do I miss?

Thanks,
//richard

  parent reply	other threads:[~2014-06-05 15:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05 14:00 oom: Be less verbose Richard Weinberger
2014-06-05 14:00 ` [RFC][PATCH] oom: Be less verbose if the oom_control event fd has listeners Richard Weinberger
2014-06-05 14:18   ` Oleg Nesterov
     [not found]     ` <20140605141841.GA23796-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-06-05 15:46       ` Richard Weinberger [this message]
2014-06-05 16:00         ` Oleg Nesterov
     [not found]           ` <20140605160029.GA28812-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-06-05 16:10             ` Richard Weinberger
2014-06-05 15:00   ` Michal Hocko
2014-06-05 15:55     ` Richard Weinberger
2014-06-05 16:18       ` Michal Hocko
     [not found]         ` <20140605161807.GD15939-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2014-06-05 21:58           ` Richard Weinberger
2014-06-05 21:01     ` David Rientjes
2014-06-06  9:10       ` Michal Hocko

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=539090F1.7090408@nod.at \
    --to=richard-/l3ra7n9ekc@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=bsingharora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=handai.szj-3b8fjiQLQpfQT0dZR+AlfA@public.gmane.org \
    --cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
    --cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
    --cc=kirill.shutemov-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=mhocko-AlSwsSmVLrQ@public.gmane.org \
    --cc=oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=rientjes-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=vdavydov-bzQdu9zFT3WakBO8gow8eQ@public.gmane.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