* [PATCH] cgroup: Drop sock_cgroup_classid() dummy implementation
@ 2025-06-03 15:45 Michal Koutný
2025-06-03 16:00 ` Waiman Long
2025-06-03 18:15 ` Tejun Heo
0 siblings, 2 replies; 4+ messages in thread
From: Michal Koutný @ 2025-06-03 15:45 UTC (permalink / raw)
To: cgroups, linux-kernel
Cc: Pablo Neira Ayuso, Michal Koutný, Tejun Heo, Johannes Weiner
The semantic of returning 0 is unclear when !CONFIG_CGROUP_NET_CLASSID.
Since there are no callers of sock_cgroup_classid() with that config
anymore we can undefine the helper at all and enforce all (future)
callers to handle cases when !CONFIG_CGROUP_NET_CLASSID.
Signed-off-by: Michal Koutný <mkoutny@suse.com>
Link: https://lore.kernel.org/r/Z_52r_v9-3JUzDT7@calendula/
Acked-by: Tejun Heo <tj@kernel.org>
---
include/linux/cgroup-defs.h | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
index e61687d5e496d..cd7f093e34cd7 100644
--- a/include/linux/cgroup-defs.h
+++ b/include/linux/cgroup-defs.h
@@ -898,14 +898,12 @@ static inline u16 sock_cgroup_prioidx(const struct sock_cgroup_data *skcd)
#endif
}
+#ifdef CONFIG_CGROUP_NET_CLASSID
static inline u32 sock_cgroup_classid(const struct sock_cgroup_data *skcd)
{
-#ifdef CONFIG_CGROUP_NET_CLASSID
return READ_ONCE(skcd->classid);
-#else
- return 0;
-#endif
}
+#endif
static inline void sock_cgroup_set_prioidx(struct sock_cgroup_data *skcd,
u16 prioidx)
@@ -915,13 +913,13 @@ static inline void sock_cgroup_set_prioidx(struct sock_cgroup_data *skcd,
#endif
}
+#ifdef CONFIG_CGROUP_NET_CLASSID
static inline void sock_cgroup_set_classid(struct sock_cgroup_data *skcd,
u32 classid)
{
-#ifdef CONFIG_CGROUP_NET_CLASSID
WRITE_ONCE(skcd->classid, classid);
-#endif
}
+#endif
#else /* CONFIG_SOCK_CGROUP_DATA */
base-commit: cd2e103d57e5615f9bb027d772f93b9efd567224
--
2.49.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] cgroup: Drop sock_cgroup_classid() dummy implementation
2025-06-03 15:45 [PATCH] cgroup: Drop sock_cgroup_classid() dummy implementation Michal Koutný
@ 2025-06-03 16:00 ` Waiman Long
2025-06-03 18:15 ` Tejun Heo
1 sibling, 0 replies; 4+ messages in thread
From: Waiman Long @ 2025-06-03 16:00 UTC (permalink / raw)
To: Michal Koutný, cgroups, linux-kernel
Cc: Pablo Neira Ayuso, Tejun Heo, Johannes Weiner
On 6/3/25 11:45 AM, Michal Koutný wrote:
> The semantic of returning 0 is unclear when !CONFIG_CGROUP_NET_CLASSID.
> Since there are no callers of sock_cgroup_classid() with that config
> anymore we can undefine the helper at all and enforce all (future)
> callers to handle cases when !CONFIG_CGROUP_NET_CLASSID.
That statement is correct with the current upstream kernel.
Reviewed-by: Waiman Long <longman@redhat.com>
> Signed-off-by: Michal Koutný <mkoutny@suse.com>
> Link: https://lore.kernel.org/r/Z_52r_v9-3JUzDT7@calendula/
> Acked-by: Tejun Heo <tj@kernel.org>
> ---
> include/linux/cgroup-defs.h | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
> index e61687d5e496d..cd7f093e34cd7 100644
> --- a/include/linux/cgroup-defs.h
> +++ b/include/linux/cgroup-defs.h
> @@ -898,14 +898,12 @@ static inline u16 sock_cgroup_prioidx(const struct sock_cgroup_data *skcd)
> #endif
> }
>
> +#ifdef CONFIG_CGROUP_NET_CLASSID
> static inline u32 sock_cgroup_classid(const struct sock_cgroup_data *skcd)
> {
> -#ifdef CONFIG_CGROUP_NET_CLASSID
> return READ_ONCE(skcd->classid);
> -#else
> - return 0;
> -#endif
> }
> +#endif
>
> static inline void sock_cgroup_set_prioidx(struct sock_cgroup_data *skcd,
> u16 prioidx)
> @@ -915,13 +913,13 @@ static inline void sock_cgroup_set_prioidx(struct sock_cgroup_data *skcd,
> #endif
> }
>
> +#ifdef CONFIG_CGROUP_NET_CLASSID
> static inline void sock_cgroup_set_classid(struct sock_cgroup_data *skcd,
> u32 classid)
> {
> -#ifdef CONFIG_CGROUP_NET_CLASSID
> WRITE_ONCE(skcd->classid, classid);
> -#endif
> }
> +#endif
>
> #else /* CONFIG_SOCK_CGROUP_DATA */
>
>
> base-commit: cd2e103d57e5615f9bb027d772f93b9efd567224
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] cgroup: Drop sock_cgroup_classid() dummy implementation
2025-06-03 15:45 [PATCH] cgroup: Drop sock_cgroup_classid() dummy implementation Michal Koutný
2025-06-03 16:00 ` Waiman Long
@ 2025-06-03 18:15 ` Tejun Heo
2025-06-03 18:27 ` Tejun Heo
1 sibling, 1 reply; 4+ messages in thread
From: Tejun Heo @ 2025-06-03 18:15 UTC (permalink / raw)
To: Michal Koutný
Cc: cgroups, linux-kernel, Pablo Neira Ayuso, Johannes Weiner
On Tue, Jun 03, 2025 at 05:45:27PM +0200, Michal Koutný wrote:
> The semantic of returning 0 is unclear when !CONFIG_CGROUP_NET_CLASSID.
> Since there are no callers of sock_cgroup_classid() with that config
> anymore we can undefine the helper at all and enforce all (future)
> callers to handle cases when !CONFIG_CGROUP_NET_CLASSID.
>
> Signed-off-by: Michal Koutný <mkoutny@suse.com>
> Link: https://lore.kernel.org/r/Z_52r_v9-3JUzDT7@calendula/
> Acked-by: Tejun Heo <tj@kernel.org>
Applied to cgroup/for-6.16-fixes.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] cgroup: Drop sock_cgroup_classid() dummy implementation
2025-06-03 18:15 ` Tejun Heo
@ 2025-06-03 18:27 ` Tejun Heo
0 siblings, 0 replies; 4+ messages in thread
From: Tejun Heo @ 2025-06-03 18:27 UTC (permalink / raw)
To: Michal Koutný
Cc: cgroups, linux-kernel, Pablo Neira Ayuso, Johannes Weiner
On Tue, Jun 03, 2025 at 08:15:34AM -1000, Tejun Heo wrote:
> On Tue, Jun 03, 2025 at 05:45:27PM +0200, Michal Koutný wrote:
> > The semantic of returning 0 is unclear when !CONFIG_CGROUP_NET_CLASSID.
> > Since there are no callers of sock_cgroup_classid() with that config
> > anymore we can undefine the helper at all and enforce all (future)
> > callers to handle cases when !CONFIG_CGROUP_NET_CLASSID.
> >
> > Signed-off-by: Michal Koutný <mkoutny@suse.com>
> > Link: https://lore.kernel.org/r/Z_52r_v9-3JUzDT7@calendula/
> > Acked-by: Tejun Heo <tj@kernel.org>
>
> Applied to cgroup/for-6.16-fixes.
Make that for-6.17.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-06-03 18:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-03 15:45 [PATCH] cgroup: Drop sock_cgroup_classid() dummy implementation Michal Koutný
2025-06-03 16:00 ` Waiman Long
2025-06-03 18:15 ` Tejun Heo
2025-06-03 18:27 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox