[Devel] [PATCH vz7] bc: don't verify "numproc" ub help on bc destroy

Konstantin Khorenko khorenko at virtuozzo.com
Tue Aug 14 12:34:57 MSK 2018


We don't have to check "numproc" ub for correctness on ub
destroy because pid cgroup does it for us.

BTW, currently it's done in a wrong way anyway - ub held
value is not synced with cgroup value before the check.

Fixes: 5d040bf27681 ("bc: implement ubc "numproc" limit based on pids cgroup")
https://jira.sw.ru/browse/PSBM-87662

Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 kernel/bc/beancounter.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/bc/beancounter.c b/kernel/bc/beancounter.c
index 4c6d1b7f5f25..2cc0bca5b353 100644
--- a/kernel/bc/beancounter.c
+++ b/kernel/bc/beancounter.c
@@ -486,6 +486,9 @@ static inline int bc_verify_held(struct user_beancounter *ub)
 	ub->ub_parms[UB_DGRAMRCVBUF].held = 0;
 	ub->ub_parms[UB_NUMOTHERSOCK].held = 0;
 
+	/* accounted by pid cgroup */
+	ub->ub_parms[UB_NUMPROC].held = 0;
+
 	clean = 1;
 	for (i = 0; i < UB_RESOURCES; i++)
 		clean &= verify_res(ub, ub_rnames[i], ub->ub_parms[i].held);
-- 
2.15.1



More information about the Devel mailing list