From: Waiman Long <llong@redhat.com>
To: Julian Sun <sunjunchao2870@gmail.com>, cgroups@vger.kernel.org
Cc: tj@kernel.org, hannes@cmpxchg.org, Julian Sun <sunjunchao@bytedance.com>
Subject: Re: [PATCH] cgroup: Remove unused css_put_many().
Date: Wed, 6 Aug 2025 09:36:58 -0400 [thread overview]
Message-ID: <eff82d2e-4030-4780-abb5-cc5ad4e91acb@redhat.com> (raw)
In-Reply-To: <20250806080457.3308817-1-sunjunchao@bytedance.com>
On 8/6/25 4:04 AM, Julian Sun wrote:
> Remove css_put_many() as it's never called by any function.
It isn't currently used doesn't mean that it will not be used in the
future. We have css_get_many() that is used in memcontrol.c. For
symmetry, we should have a corresponding css_put_many(). Also there is
little cost in keeping this little helper function around.
Cheers,
Longman
>
> Signed-off-by: Julian Sun <sunjunchao@bytedance.com>
> ---
> include/linux/cgroup.h | 1 -
> include/linux/cgroup_refcnt.h | 15 ---------------
> 2 files changed, 16 deletions(-)
>
> diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
> index b18fb5fcb38e..2e232eb8c897 100644
> --- a/include/linux/cgroup.h
> +++ b/include/linux/cgroup.h
> @@ -322,7 +322,6 @@ void css_get_many(struct cgroup_subsys_state *css, unsigned int n);
> bool css_tryget(struct cgroup_subsys_state *css);
> bool css_tryget_online(struct cgroup_subsys_state *css);
> void css_put(struct cgroup_subsys_state *css);
> -void css_put_many(struct cgroup_subsys_state *css, unsigned int n);
> #else
> #define CGROUP_REF_FN_ATTRS static inline
> #define CGROUP_REF_EXPORT(fn)
> diff --git a/include/linux/cgroup_refcnt.h b/include/linux/cgroup_refcnt.h
> index 2eea0a69ecfc..1cede70a928c 100644
> --- a/include/linux/cgroup_refcnt.h
> +++ b/include/linux/cgroup_refcnt.h
> @@ -79,18 +79,3 @@ void css_put(struct cgroup_subsys_state *css)
> percpu_ref_put(&css->refcnt);
> }
> CGROUP_REF_EXPORT(css_put)
> -
> -/**
> - * css_put_many - put css references
> - * @css: target css
> - * @n: number of references to put
> - *
> - * Put references obtained via css_get() and css_tryget_online().
> - */
> -CGROUP_REF_FN_ATTRS
> -void css_put_many(struct cgroup_subsys_state *css, unsigned int n)
> -{
> - if (!(css->flags & CSS_NO_REF))
> - percpu_ref_put_many(&css->refcnt, n);
> -}
> -CGROUP_REF_EXPORT(css_put_many)
prev parent reply other threads:[~2025-08-06 13:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-06 8:04 [PATCH] cgroup: Remove unused css_put_many() Julian Sun
2025-08-06 13:36 ` Waiman Long [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eff82d2e-4030-4780-abb5-cc5ad4e91acb@redhat.com \
--to=llong@redhat.com \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=sunjunchao2870@gmail.com \
--cc=sunjunchao@bytedance.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).