Re: [RFC][PATCH] oom: Be less verbose if the oom_control event fd has listeners

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/05, Richard Weinberger wrote:
>
> 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.

And? How this lock can help to check list_empty() ?

list_add/del can come right after mem_cgroup_has_listeners() and change
the value of list_empty() anyway.

> What do I miss?

Or me...

Oleg.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]