cgroup: make CONFIG_CGROUP_NET_PRIO bool and drop unnecessary init_netclassid_cgroup()
net_prio is the only cgroup which is allowed to be built as a module. The savings from allowing one controller to be built as a module are tiny especially given that cgroup module support itself adds quite a bit of complexity. Given that none of other controllers has much chance of being made a module and that we're unlikely to add new modular controllers, the added complexity is simply not justifiable. As a first step to drop cgroup module support, this patch changes the config option to bool from tristate and drops module related code from it. Also, while an earlier commitfe1217c4f3("net: net_cls: move cgroupfs classid handling into core") dropped module support from net_cls cgroup, it retained a call to cgroup_load_subsys(), which is noop for built-in controllers. Drop it along with init_netclassid_cgroup(). v2: Removed modular version of task_netprioidx() in include/net/netprio_cgroup.h as suggested by Li Zefan. v3: Rebased on top offe1217c4f3("net: net_cls: move cgroupfs classid handling into core"). net_cls cgroup part is mostly dropped except for removal of init_netclassid_cgroup(). Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Neil Horman <nhorman@tuxdriver.com> Acked-by: "David S. Miller" <davem@davemloft.net> Acked-by: Li Zefan <lizefan@huawei.com> Cc: Thomas Graf <tgraf@suug.ch>
This commit is contained in:
@@ -27,7 +27,6 @@ struct netprio_map {
|
||||
|
||||
void sock_update_netprioidx(struct sock *sk);
|
||||
|
||||
#if IS_BUILTIN(CONFIG_CGROUP_NET_PRIO)
|
||||
static inline u32 task_netprioidx(struct task_struct *p)
|
||||
{
|
||||
struct cgroup_subsys_state *css;
|
||||
@@ -39,20 +38,6 @@ static inline u32 task_netprioidx(struct task_struct *p)
|
||||
rcu_read_unlock();
|
||||
return idx;
|
||||
}
|
||||
#elif IS_MODULE(CONFIG_CGROUP_NET_PRIO)
|
||||
static inline u32 task_netprioidx(struct task_struct *p)
|
||||
{
|
||||
struct cgroup_subsys_state *css;
|
||||
u32 idx = 0;
|
||||
|
||||
rcu_read_lock();
|
||||
css = task_css(p, net_prio_subsys_id);
|
||||
if (css)
|
||||
idx = css->cgroup->id;
|
||||
rcu_read_unlock();
|
||||
return idx;
|
||||
}
|
||||
#endif
|
||||
#else /* !CONFIG_CGROUP_NET_PRIO */
|
||||
static inline u32 task_netprioidx(struct task_struct *p)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user