提交 ae093b37 编写于 作者: L Lukáš Doktor

cgroup: Allow 5% of extra pages when RSS only limit

Moving pages to swap is a background task and can take a while. In the
mean-time the proces might alocate new pages breaking the limit
temporarily. Let's allow 5% overcommit in such case.

Note: this should never happen with mem+swap limit, because we know in
advance how much swap and mem we have left.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 7a44932c
......@@ -1941,9 +1941,10 @@ def run(test, params, env):
logging.info(out)
else: # only RSS limit
exit_nr = session.cmd_output("echo $?")[:-1]
if max_rss > mem_limit:
err = ("The limit was broken: max_rss=%s, limit=%s" %
(max_rss, mem_limit))
if max_rss > mem_limit * 1.05:
# Allow 5% pages to be in-progress of swapping out
err = ("The limit was broken: max_rss=%s, limit=%s (+5%%)"
% (max_rss, mem_limit))
elif exit_nr != '0':
err = ("dd command failed(%s) output: %s" % (exit_nr, out))
elif (max_rssswap) < mem_limit:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册