<div dir="ltr"><div class="gmail_quote"><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+static void run(void)<br>
+{<br>
+       char buf[BUFSIZ];<br>
+       size_t mem = 0;<br>
+<br>
+       cg_child = tst_cgroup_mk(cg, "child");<br>
+       SAFE_CGROUP_PRINTF(cg_child, "cgroup.procs", "%d", getpid());<br>
+<br>
+       if (SAFE_CGROUP_VER(cg, "memory") != TST_CGROUP_V1)<br>
+               SAFE_CGROUP_PRINT(cg, "cgroup.subtree_control", "+memory");<br>
+       if (SAFE_CGROUP_VER(cg, "cpuset") != TST_CGROUP_V1)<br>
+               SAFE_CGROUP_PRINT(cg, "cgroup.subtree_control", "+cpuset");<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Kind reminder:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you decide to add controllers automatically (as I suggested in patch3/7) in</div><div class="gmail_default" style="font-size:small">tst_cgroup_mk(), then these lines should be removed.</div></div><div class="gmail_default" style="font-size:small"> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+Another example of an edge case is the following.<br>
+<br>
+[source,c]<br>
+-------------------------------------------------------------------------------<br>
+       if (tst_cgroup_ver(cg, "memory") == TST_CGROUP_V1)<br>
+               SAFE_CGROUP_PRINTF(cg, "memory.swap.max", "%lu", ~0UL);<br>
+       else<br>
+               SAFE_CGROUP_PRINT(cg, "memory.swap.max", "max");<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">typo PRINT --> PRINTF ^.</div></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_default" style="font-size:small">Btw, these <span style="color:rgb(51,51,51);font-size:14px">documented</span> works are quite awesome!</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>