* A/B memory.min = 50M, memory.current = 50M
* A/B/C memory.min = 75M, memory.current = 50M
* A/B/D memory.min = 25M, memory.current = 50M
- * A/B/E memory.min = 500M, memory.current = 0
- * A/B/F memory.min = 0, memory.current = 50M
+ * A/B/E memory.min = 0, memory.current = 50M
+ * A/B/F memory.min = 500M, memory.current = 0
*
* Usages are pagecache, but the test keeps a running
* process in every leaf cgroup.
* A/B memory.current ~= 50M
* A/B/C memory.current ~= 33M
* A/B/D memory.current ~= 17M
- * A/B/E memory.current ~= 0
+ * A/B/F memory.current ~= 0
*
* After that it tries to allocate more than there is
* unprotected memory in A available, and checks
if (cg_create(children[i]))
goto cleanup;
- if (i == 2)
+ if (i > 2)
continue;
cg_run_nowait(children[i], alloc_pagecache_50M_noexit,
goto cleanup;
if (cg_write(children[1], "memory.min", "25M"))
goto cleanup;
- if (cg_write(children[2], "memory.min", "500M"))
+ if (cg_write(children[2], "memory.min", "0"))
goto cleanup;
- if (cg_write(children[3], "memory.min", "0"))
+ if (cg_write(children[3], "memory.min", "500M"))
goto cleanup;
attempts = 0;
if (!values_close(c[1], MB(17), 10))
goto cleanup;
- if (!values_close(c[2], 0, 1))
+ if (c[3] != 0)
goto cleanup;
if (!cg_run(parent[2], alloc_anon, (void *)MB(170)))
* A/B memory.low = 50M, memory.current = 50M
* A/B/C memory.low = 75M, memory.current = 50M
* A/B/D memory.low = 25M, memory.current = 50M
- * A/B/E memory.low = 500M, memory.current = 0
- * A/B/F memory.low = 0, memory.current = 50M
+ * A/B/E memory.low = 0, memory.current = 50M
+ * A/B/F memory.low = 500M, memory.current = 0
*
* Usages are pagecache.
* Then it creates A/G an creates a significant
* A/B memory.current ~= 50M
* A/B/ memory.current ~= 33M
* A/B/D memory.current ~= 17M
- * A/B/E memory.current ~= 0
+ * A/B/F memory.current ~= 0
*
* After that it tries to allocate more than there is
* unprotected memory in A available,
if (cg_create(children[i]))
goto cleanup;
- if (i == 2)
+ if (i > 2)
continue;
if (cg_run(children[i], alloc_pagecache_50M, (void *)(long)fd))
goto cleanup;
if (cg_write(children[1], "memory.low", "25M"))
goto cleanup;
- if (cg_write(children[2], "memory.low", "500M"))
+ if (cg_write(children[2], "memory.low", "0"))
goto cleanup;
- if (cg_write(children[3], "memory.low", "0"))
+ if (cg_write(children[3], "memory.low", "500M"))
goto cleanup;
if (cg_run(parent[2], alloc_anon, (void *)MB(148)))
if (!values_close(c[1], MB(17), 10))
goto cleanup;
- if (!values_close(c[2], 0, 1))
+ if (c[3] != 0)
goto cleanup;
if (cg_run(parent[2], alloc_anon, (void *)MB(166))) {