[Fwd: [PATCH -RSS 2/2] Fix limit check after reclaim]

Balbir Singh balbir at linux.vnet.ibm.com
Mon Jun 4 23:58:54 PDT 2007


Pavel Emelianov wrote:
>> +static inline bool res_counter_check_under_limit(struct res_counter *cnt)
>> +{
>> +	bool ret;
>> +	unsigned long flags;
>> +
>> +	spin_lock_irqsave(&cnt->lock, flags);
>> +	ret = res_counter_limit_check_locked(cnt);
> 
> We don't have to take the lock for such a check.
> 
 
This check without the lock could be racy and return incorrect
results -- leading to OOM.


-- 
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL


More information about the Containers mailing list