<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="caret-color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important"><span style="caret-color: rgb(0, 0, 0); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; font-size: 14.666666984558105px; background-color: rgb(255, 255, 255); display: inline !important">>1)You
have to add my Reviewed-by tags only for patches, where I've really given it.</span></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="caret-color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important"><span style="caret-color: rgb(0, 0, 0); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; font-size: 14.666666984558105px; background-color: rgb(255, 255, 255); display: inline !important"><br>
</span></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="caret-color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important"><span style="caret-color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important">My
bad, I've done a poor job of matching them in reply series from you. I've definitely misinterpreted your series of replies yesterday.</span><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="caret-color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); display: inline !important"><span style="caret-color: rgb(0, 0, 0); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; font-size: 14.666666984558105px; background-color: rgb(255, 255, 255); display: inline !important">>There
were not my ack to patches 6-9/9.</span><br>
</span></div>
<div style="color: rgb(0, 0, 0);"><span style="font-size: 14.666666984558105px;">Ok, I see it now.</span></div>
<div style="color: rgb(0, 0, 0);"><span style="font-size: 14.666666984558105px;"><br>
</span></div>
<div style="color: rgb(0, 0, 0);"><span style="font-size: 14.666666984558105px;">><span style="caret-color: rgb(0, 0, 0); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important">2)Have
you read my answer to "Re: [PATCH v8 6/9] ve/cgroup: unmark ve-root cgroups at container stop"?</span></span></div>
<div style="color: rgb(0, 0, 0);"><span style="font-size: 14.666666984558105px;"><span style="caret-color: rgb(0, 0, 0); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important">>><span style="caret-color: rgb(0, 0, 0); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important">How
can we access ve_owner when it is not defined yet? It goes in next patch.</span><br style="caret-color: rgb(0, 0, 0); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif">
<span style="caret-color: rgb(0, 0, 0); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important">>>Can we
move ve->ve_owner declaration and assignment in this patch?</span></span></span></div>
<div style="color: rgb(0, 0, 0);"><span style="font-size: 14.666666984558105px;"><span style="caret-color: rgb(0, 0, 0); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important"><span style="caret-color: rgb(0, 0, 0); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important"><br>
</span></span></span></div>
<div style="color: rgb(0, 0, 0);"><span style="font-size: 14.666666984558105px;"><span style="caret-color: rgb(0, 0, 0); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important"><span style="caret-color: rgb(0, 0, 0); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important">Sure.
I've fixed that.</span></span></span></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Kirill Tkhai <ktkhai@virtuozzo.com><br>
<b>Sent:</b> Friday, April 17, 2020 10:42 AM<br>
<b>To:</b> Valeriy Vdovin <Valeriy.Vdovin@virtuozzo.com>; devel@openvz.org <devel@openvz.org>; Konstantin Khorenko <khorenko@virtuozzo.com>; Pavel Tikhomirov <ptikhomirov@virtuozzo.com><br>
<b>Subject:</b> Re: [PATCH v10 6/9] ve/cgroup: unmark ve-root cgroups at container stop</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On 16.04.2020 19:14, Valeriy Vdovin wrote:<br>
> Signed-off-by: Valeriy Vdovin <valeriy.vdovin@virtuozzo.com><br>
> Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com><br>
<br>
1)You have to add my Reviewed-by tags only for patches, where I've really given it.<br>
There were not my ack to patches 6-9/9.<br>
<br>
2)Have you read my answer to "Re: [PATCH v8 6/9] ve/cgroup: unmark ve-root cgroups at container stop"?<br>
<br>
> ---<br>
> include/linux/cgroup.h | 1 +<br>
> kernel/cgroup.c | 42 ++++++++++++++++++++++++++++++++++++++++++<br>
> kernel/ve/ve.c | 2 ++<br>
> 3 files changed, 45 insertions(+)<br>
> <br>
> diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h<br>
> index 0a42f93..1bd0fe7 100644<br>
> --- a/include/linux/cgroup.h<br>
> +++ b/include/linux/cgroup.h<br>
> @@ -636,6 +636,7 @@ int cgroup_task_count(const struct cgroup *cgrp);<br>
> <br>
> #ifdef CONFIG_VE<br>
> void cgroup_mark_ve_roots(struct ve_struct *ve);<br>
> +void cgroup_unmark_ve_roots(struct ve_struct *ve);<br>
> #endif<br>
> <br>
> /*<br>
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c<br>
> index 60a4ca4..1dd36ed 100644<br>
> --- a/kernel/cgroup.c<br>
> +++ b/kernel/cgroup.c<br>
> @@ -635,6 +635,35 @@ static struct css_set *find_css_set(<br>
> }<br>
> <br>
> /*<br>
> + * Walk each cgroup link of a given css_set and find a cgroup that<br>
> + * is the child of cgroupfs_root in argument.<br>
> + */<br>
> +static struct cgroup *css_cgroup_from_root(struct css_set *css_set,<br>
> + struct cgroupfs_root *root)<br>
> +{<br>
> + struct cgroup *res = NULL;<br>
> +<br>
> + BUG_ON(!mutex_is_locked(&cgroup_mutex));<br>
> + read_lock(&css_set_lock);<br>
> +<br>
> + if (css_set == &init_css_set) {<br>
> + res = &root->top_cgroup;<br>
> + } else {<br>
> + struct cg_cgroup_link *link;<br>
> + list_for_each_entry(link, &css_set->cg_links, cg_link_list) {<br>
> + struct cgroup *c = link->cgrp;<br>
> + if (c->root == root) {<br>
> + res = c;<br>
> + break;<br>
> + }<br>
> + }<br>
> + }<br>
> + read_unlock(&css_set_lock);<br>
> + BUG_ON(!res);<br>
> + return res;<br>
> +}<br>
> +<br>
> +/*<br>
> * Return the cgroup for "task" from the given hierarchy. Must be<br>
> * called with cgroup_mutex held.<br>
> */<br>
> @@ -4237,6 +4266,19 @@ void cgroup_mark_ve_roots(struct ve_struct *ve)<br>
> mutex_unlock(&cgroup_mutex);<br>
> }<br>
> <br>
> +void cgroup_unmark_ve_roots(struct ve_struct *ve)<br>
> +{<br>
> + struct cgroup *cgrp;<br>
> + struct cgroupfs_root *root;<br>
> +<br>
> + mutex_lock(&cgroup_mutex);<br>
> + for_each_active_root(root) {<br>
> + cgrp = css_cgroup_from_root(ve->root_css_set, root);<br>
> + clear_bit(CGRP_VE_ROOT, &cgrp->flags);<br>
> + }<br>
> + mutex_unlock(&cgroup_mutex);<br>
> +}<br>
> +<br>
> struct cgroup *cgroup_get_ve_root(struct cgroup *cgrp)<br>
> {<br>
> struct cgroup *ve_root = NULL;<br>
> diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c<br>
> index eedb85d..db3b600 100644<br>
> --- a/kernel/ve/ve.c<br>
> +++ b/kernel/ve/ve.c<br>
> @@ -618,6 +618,8 @@ void ve_exit_ns(struct pid_namespace *pid_ns)<br>
> if (!ve->ve_ns || ve->ve_ns->pid_ns != pid_ns)<br>
> return;<br>
> <br>
> + cgroup_unmark_ve_roots(ve);<br>
> +<br>
> ve_workqueue_stop(ve);<br>
> <br>
> /*<br>
> <br>
<br>
</div>
</span></font></div>
</body>
</html>