[VZ8] cgroup: revert unused code from cherry-picked release_agent patchset

Submitted by Valeriy Vdovin on March 4, 2021, 9:19 a.m.

Details

Message ID 1614849585-960527-1-git-send-email-valeriy.vdovin@virtuozzo.com
State New
Series "cgroup: revert unused code from cherry-picked release_agent patchset"
Headers show

Commit Message

Valeriy Vdovin March 4, 2021, 9:19 a.m.
This reverts some of the cherry-picked code from release agent
patchset from VZ7.

Commit 38d7d0783105d3a22f9bbae8bbd9866abe646c11:
  fully reverted

Commit 8fb15caacff3fa33ffc67dbbe2037280a3c2f3ba:
  moved function cset_cgroup_from_root is reverted into it's
  original location.

Signed-off-by: Valeriy Vdovin <valeriy.vdovin@virtuozzo.com>
---
 include/linux/cgroup.h          | 28 ----------------------------
 kernel/cgroup/cgroup-internal.h | 28 ++++++++++++++++++++++++++--
 kernel/cgroup/cgroup.c          |  3 +--
 3 files changed, 27 insertions(+), 32 deletions(-)

Patch hide | download patch | download mbox

diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 8f0d057abb25..42ce2ece14f8 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -512,34 +512,6 @@  task_get_css(struct task_struct *task, int subsys_id)
 	return css;
 }
 
-void put_css_set_locked(struct css_set *cset);
-
-static inline void put_css_set(struct css_set *cset)
-{
-	unsigned long flags;
-
-	/*
-	 * Ensure that the refcount doesn't hit zero while any readers
-	 * can see it. Similar to atomic_dec_and_lock(), but for an
-	 * rwlock
-	 */
-	if (refcount_dec_not_one(&cset->refcount))
-		return;
-
-	spin_lock_irqsave(&css_set_lock, flags);
-	put_css_set_locked(cset);
-	spin_unlock_irqrestore(&css_set_lock, flags);
-}
-
-/*
- * refcounted get/put for css_set objects
- */
-static inline void get_css_set(struct css_set *cset)
-{
-	refcount_inc(&cset->refcount);
-}
-
-
 /**
  * task_css_is_root - test whether a task belongs to the root css
  * @task: the target task
diff --git a/kernel/cgroup/cgroup-internal.h b/kernel/cgroup/cgroup-internal.h
index 112bd917e99d..249630a9c239 100644
--- a/kernel/cgroup/cgroup-internal.h
+++ b/kernel/cgroup/cgroup-internal.h
@@ -160,8 +160,32 @@  static inline bool notify_on_release(const struct cgroup *cgrp)
 	return test_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
 }
 
-struct cgroup *cset_cgroup_from_root(struct css_set *cset,
-					    struct cgroup_root *root);
+void put_css_set_locked(struct css_set *cset);
+
+static inline void put_css_set(struct css_set *cset)
+{
+	unsigned long flags;
+
+	/*
+	 * Ensure that the refcount doesn't hit zero while any readers
+	 * can see it. Similar to atomic_dec_and_lock(), but for an
+	 * rwlock
+	 */
+	if (refcount_dec_not_one(&cset->refcount))
+		return;
+
+	spin_lock_irqsave(&css_set_lock, flags);
+	put_css_set_locked(cset);
+	spin_unlock_irqrestore(&css_set_lock, flags);
+}
+
+/*
+ * refcounted get/put for css_set objects
+ */
+static inline void get_css_set(struct css_set *cset)
+{
+	refcount_inc(&cset->refcount);
+}
 
 bool cgroup_ssid_enabled(int ssid);
 bool cgroup_on_dfl(const struct cgroup *cgrp);
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 09d328b76dab..779a71bdbaef 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -58,7 +58,6 @@ 
 #include <linux/psi.h>
 #include <net/sock.h>
 #include <linux/ve.h>
-#include <linux/cgroup.h>
 
 #include <linux/rh_features.h>
 
@@ -1436,7 +1435,7 @@  current_cgns_cgroup_from_root(struct cgroup_root *root)
 }
 
 /* look up cgroup associated with given css_set on the specified hierarchy */
-struct cgroup *cset_cgroup_from_root(struct css_set *cset,
+static struct cgroup *cset_cgroup_from_root(struct css_set *cset,
 					    struct cgroup_root *root)
 {
 	struct cgroup *res = NULL;

Comments

Konstantin Khorenko March 4, 2021, 10:28 a.m.
Applied in 4.18.0-240.1.1.vz8.5.6
--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 03/04/2021 12:19 PM, Valeriy Vdovin wrote:
> This reverts some of the cherry-picked code from release agent
> patchset from VZ7.
>
> Commit 38d7d0783105d3a22f9bbae8bbd9866abe646c11:
>   fully reverted
>
> Commit 8fb15caacff3fa33ffc67dbbe2037280a3c2f3ba:
>   moved function cset_cgroup_from_root is reverted into it's
>   original location.
>
> Signed-off-by: Valeriy Vdovin <valeriy.vdovin@virtuozzo.com>
> ---
>  include/linux/cgroup.h          | 28 ----------------------------
>  kernel/cgroup/cgroup-internal.h | 28 ++++++++++++++++++++++++++--
>  kernel/cgroup/cgroup.c          |  3 +--
>  3 files changed, 27 insertions(+), 32 deletions(-)
>
> diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
> index 8f0d057abb25..42ce2ece14f8 100644
> --- a/include/linux/cgroup.h
> +++ b/include/linux/cgroup.h
> @@ -512,34 +512,6 @@ task_get_css(struct task_struct *task, int subsys_id)
>  	return css;
>  }
>
> -void put_css_set_locked(struct css_set *cset);
> -
> -static inline void put_css_set(struct css_set *cset)
> -{
> -	unsigned long flags;
> -
> -	/*
> -	 * Ensure that the refcount doesn't hit zero while any readers
> -	 * can see it. Similar to atomic_dec_and_lock(), but for an
> -	 * rwlock
> -	 */
> -	if (refcount_dec_not_one(&cset->refcount))
> -		return;
> -
> -	spin_lock_irqsave(&css_set_lock, flags);
> -	put_css_set_locked(cset);
> -	spin_unlock_irqrestore(&css_set_lock, flags);
> -}
> -
> -/*
> - * refcounted get/put for css_set objects
> - */
> -static inline void get_css_set(struct css_set *cset)
> -{
> -	refcount_inc(&cset->refcount);
> -}
> -
> -
>  /**
>   * task_css_is_root - test whether a task belongs to the root css
>   * @task: the target task
> diff --git a/kernel/cgroup/cgroup-internal.h b/kernel/cgroup/cgroup-internal.h
> index 112bd917e99d..249630a9c239 100644
> --- a/kernel/cgroup/cgroup-internal.h
> +++ b/kernel/cgroup/cgroup-internal.h
> @@ -160,8 +160,32 @@ static inline bool notify_on_release(const struct cgroup *cgrp)
>  	return test_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
>  }
>
> -struct cgroup *cset_cgroup_from_root(struct css_set *cset,
> -					    struct cgroup_root *root);
> +void put_css_set_locked(struct css_set *cset);
> +
> +static inline void put_css_set(struct css_set *cset)
> +{
> +	unsigned long flags;
> +
> +	/*
> +	 * Ensure that the refcount doesn't hit zero while any readers
> +	 * can see it. Similar to atomic_dec_and_lock(), but for an
> +	 * rwlock
> +	 */
> +	if (refcount_dec_not_one(&cset->refcount))
> +		return;
> +
> +	spin_lock_irqsave(&css_set_lock, flags);
> +	put_css_set_locked(cset);
> +	spin_unlock_irqrestore(&css_set_lock, flags);
> +}
> +
> +/*
> + * refcounted get/put for css_set objects
> + */
> +static inline void get_css_set(struct css_set *cset)
> +{
> +	refcount_inc(&cset->refcount);
> +}
>
>  bool cgroup_ssid_enabled(int ssid);
>  bool cgroup_on_dfl(const struct cgroup *cgrp);
> diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
> index 09d328b76dab..779a71bdbaef 100644
> --- a/kernel/cgroup/cgroup.c
> +++ b/kernel/cgroup/cgroup.c
> @@ -58,7 +58,6 @@
>  #include <linux/psi.h>
>  #include <net/sock.h>
>  #include <linux/ve.h>
> -#include <linux/cgroup.h>
>
>  #include <linux/rh_features.h>
>
> @@ -1436,7 +1435,7 @@ current_cgns_cgroup_from_root(struct cgroup_root *root)
>  }
>
>  /* look up cgroup associated with given css_set on the specified hierarchy */
> -struct cgroup *cset_cgroup_from_root(struct css_set *cset,
> +static struct cgroup *cset_cgroup_from_root(struct css_set *cset,
>  					    struct cgroup_root *root)
>  {
>  	struct cgroup *res = NULL;
>