* [PATCH] cgroup/misc: Remove unused misc_cg_res_total_usage
@ 2025-01-27 23:52 linux
2025-01-28 9:16 ` Michal Koutný
2025-01-28 19:01 ` Tejun Heo
0 siblings, 2 replies; 3+ messages in thread
From: linux @ 2025-01-27 23:52 UTC (permalink / raw)
To: tj, hannes, mkoutny; +Cc: cgroups, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
misc_cg_res_total_usage() was added in 2021 by
commit a72232eabdfc ("cgroup: Add misc cgroup controller")
but has remained unused.
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
include/linux/misc_cgroup.h | 6 ------
kernel/cgroup/misc.c | 16 ----------------
2 files changed, 22 deletions(-)
diff --git a/include/linux/misc_cgroup.h b/include/linux/misc_cgroup.h
index 49eef10c8e59..4bf261d41a6d 100644
--- a/include/linux/misc_cgroup.h
+++ b/include/linux/misc_cgroup.h
@@ -60,7 +60,6 @@ struct misc_cg {
struct misc_res res[MISC_CG_RES_TYPES];
};
-u64 misc_cg_res_total_usage(enum misc_res_type type);
int misc_cg_set_capacity(enum misc_res_type type, u64 capacity);
int misc_cg_try_charge(enum misc_res_type type, struct misc_cg *cg, u64 amount);
void misc_cg_uncharge(enum misc_res_type type, struct misc_cg *cg, u64 amount);
@@ -104,11 +103,6 @@ static inline void put_misc_cg(struct misc_cg *cg)
#else /* !CONFIG_CGROUP_MISC */
-static inline u64 misc_cg_res_total_usage(enum misc_res_type type)
-{
- return 0;
-}
-
static inline int misc_cg_set_capacity(enum misc_res_type type, u64 capacity)
{
return 0;
diff --git a/kernel/cgroup/misc.c b/kernel/cgroup/misc.c
index 0e26068995a6..2fa3a4fb2aaf 100644
--- a/kernel/cgroup/misc.c
+++ b/kernel/cgroup/misc.c
@@ -67,22 +67,6 @@ static inline bool valid_type(enum misc_res_type type)
return type >= 0 && type < MISC_CG_RES_TYPES;
}
-/**
- * misc_cg_res_total_usage() - Get the current total usage of the resource.
- * @type: misc res type.
- *
- * Context: Any context.
- * Return: Current total usage of the resource.
- */
-u64 misc_cg_res_total_usage(enum misc_res_type type)
-{
- if (valid_type(type))
- return atomic64_read(&root_cg.res[type].usage);
-
- return 0;
-}
-EXPORT_SYMBOL_GPL(misc_cg_res_total_usage);
-
/**
* misc_cg_set_capacity() - Set the capacity of the misc cgroup res.
* @type: Type of the misc res.
--
2.48.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cgroup/misc: Remove unused misc_cg_res_total_usage
2025-01-27 23:52 [PATCH] cgroup/misc: Remove unused misc_cg_res_total_usage linux
@ 2025-01-28 9:16 ` Michal Koutný
2025-01-28 19:01 ` Tejun Heo
1 sibling, 0 replies; 3+ messages in thread
From: Michal Koutný @ 2025-01-28 9:16 UTC (permalink / raw)
To: linux; +Cc: tj, hannes, cgroups, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 607 bytes --]
On Mon, Jan 27, 2025 at 11:52:14PM +0000, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> misc_cg_res_total_usage() was added in 2021 by
> commit a72232eabdfc ("cgroup: Add misc cgroup controller")
>
> but has remained unused.
It can be used by out-of-tree modules in theory.
But the information is more likely used by userspace than internal
consumers as of
e973dfe929944 ("cgroup/misc: Expose misc.current on cgroup v2 root") v6.5-rc1~187^2~1
> Remove it.
I think it's fine to remove it now.
Acked-by: Michal Koutný <mkoutny@suse.com>
Michal
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cgroup/misc: Remove unused misc_cg_res_total_usage
2025-01-27 23:52 [PATCH] cgroup/misc: Remove unused misc_cg_res_total_usage linux
2025-01-28 9:16 ` Michal Koutný
@ 2025-01-28 19:01 ` Tejun Heo
1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2025-01-28 19:01 UTC (permalink / raw)
To: linux; +Cc: hannes, mkoutny, cgroups, linux-kernel
On Mon, Jan 27, 2025 at 11:52:14PM +0000, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> misc_cg_res_total_usage() was added in 2021 by
> commit a72232eabdfc ("cgroup: Add misc cgroup controller")
>
> but has remained unused.
>
> Remove it.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Applied to cgroup/for-6.15.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-28 19:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-27 23:52 [PATCH] cgroup/misc: Remove unused misc_cg_res_total_usage linux
2025-01-28 9:16 ` Michal Koutný
2025-01-28 19:01 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®