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

From: Richard Weinberger
Date: Thu Jun 05 2014 - 11:47:11 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/