[Devel] [VZ8 PATCH 3/3] cgroup: port CGROUP_REMOVED flag from vz7

Konstantin Khorenko khorenko at virtuozzo.com
Thu Jan 28 11:50:40 MSK 2021


ms commits:

commit 54766d4a1d3d6f84ff8fa475cd8f165c0a0000eb
Author: Tejun Heo <tj at kernel.org>
Date:   Wed Jun 12 21:04:53 2013 -0700
     cgroup: rename CGRP_REMOVED to CGRP_DEAD

+

commit 184faf32328c65c9d86b19577b8d8b90bdd2cd2e
Author: Tejun Heo <tj at kernel.org>
Date:   Fri May 16 13:22:51 2014 -0400
     cgroup: use CSS_ONLINE instead of CGRP_DEAD

=> the current patch is not needed, let's rework places where CGRP_REMOVED is used during the rebase.

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 01/18/2021 09:08 PM, Valeriy Vdovin wrote:
> The flag will be used in subsequent porting patches for release_agent
> functionality
> Signed-off-by: Valeriy Vdovin <valeriy.vdovin at virtuozzo.com>
> ---
>  include/linux/cgroup-defs.h | 2 ++
>  include/linux/cgroup.h      | 5 +++++
>  kernel/cgroup/cgroup.c      | 1 +
>  3 files changed, 8 insertions(+)
>
> diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
> index a3b309ab1a90..5ee5f10e3de7 100644
> --- a/include/linux/cgroup-defs.h
> +++ b/include/linux/cgroup-defs.h
> @@ -57,6 +57,8 @@ enum {
>
>  /* bits in struct cgroup flags field */
>  enum {
> +	/* Control Cgroup is dead */
> +	CGRP_REMOVED,
>  	/* Control Group requires release notifications to userspace */
>  	CGRP_NOTIFY_ON_RELEASE,
>  	/*
> diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
> index c0a42c3d43fa..dfd9460986ee 100644
> --- a/include/linux/cgroup.h
> +++ b/include/linux/cgroup.h
> @@ -922,6 +922,11 @@ static inline bool cgroup_task_frozen(struct task_struct *task)
>  	return task->frozen;
>  }
>
> +static inline int cgroup_is_removed(const struct cgroup *cgrp)
> +{
> +	return test_bit(CGRP_REMOVED, &cgrp->flags);
> +}
> +
>  #else /* !CONFIG_CGROUPS */
>
>  static inline void cgroup_enter_frozen(void) { }
> diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
> index 797a3971ab46..447c8f003496 100644
> --- a/kernel/cgroup/cgroup.c
> +++ b/kernel/cgroup/cgroup.c
> @@ -5562,6 +5562,7 @@ static int cgroup_destroy_locked(struct cgroup *cgrp)
>  			tcgrp->freezer.nr_frozen_descendants--;
>  	}
>  	spin_unlock_irq(&css_set_lock);
> +	set_bit(CGRP_REMOVED, &cgrp->flags);
>
>  	cgroup1_check_for_release(parent);
>
>


More information about the Devel mailing list