[Devel] [PATCH rh7 05/11] ub: sync memcg before setting limit via sys_setublimit

Vladimir Davydov vdavydov at parallels.com
Wed May 20 05:09:14 PDT 2015


Otherwise, sys_setublimit can reset limits for resources accounted by
memcg.

Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 kernel/bc/sys.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/bc/sys.c b/kernel/bc/sys.c
index 096aa978b04e..3c0b9abf0df4 100644
--- a/kernel/bc/sys.c
+++ b/kernel/bc/sys.c
@@ -93,6 +93,8 @@ long do_setublimit(uid_t uid, unsigned long resource,
 		goto out;
 	}
 
+	ub_sync_memcg(ub);
+
 	spin_lock_irqsave(&ub->ub_lock, flags);
 	ub->ub_parms[resource].barrier = new_limits[0];
 	ub->ub_parms[resource].limit = new_limits[1];
-- 
1.7.10.4




More information about the Devel mailing list