Skip to contentSkip to conversation

cpuset: initialize cpuset a bit early

PATCH Applied Zefan Li 4 participants 4 messages Mar 4, 2015 – Mar 5, 2015 cgroup

lore
Share & tools
lore

Zefan Li

author
#0 lore raw

PATCH 1/1 cpuset: initialize cpuset a bit early

Now we call ss->bind() in cgroup_init(), so cgroup_init() will call cpuset_bind() and then the latter will access top_cpuset's cpumask, which is NULL, because cpuset_init() is called after cgroup_init()

The simplest fix is to swap cgroup_init() and cpuset_init().

Cc Vladimir Davydov <[email protected]>
Fixes 295458e67284 ("cgroup: call cgroup_subsys->bind on cgroup subsys initialization")

Reported by: Ming Lei <[email protected]>

---
 init/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
init/main.c +1 -1
index 61b9937..50d1e95 100644
@@ -667,8 +667,8 @@ asmlinkage __visible void __init start_kernel(void)
 	page_writeback_init();
 	proc_root_init();
 	nsfs_init();
-	cgroup_init();
 	cpuset_init();
+	cgroup_init();
 	taskstats_init_early();
 	delayacct_init();
 
Signature · 1 line
1.8.0.2
#1 lore raw
Quoted 11 lines · Zefan Li

Now we call ss->bind() in cgroup_init(), so cgroup_init() will call cpuset_bind() and then the latter will access top_cpuset's cpumask, which is NULL, because cpuset_init() is called after cgroup_init()

The simplest fix is to swap cgroup_init() and cpuset_init().

Cc Vladimir Davydov <[email protected]>
Fixes 295458e67284 ("cgroup: call cgroup_subsys->bind on cgroup subsys initialization")

Reported by: Ming Lei <[email protected]>

Looks this patch does fix the boot issue.

Quoted 19 lines
---
 init/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
init/main.c +1 -2
index 61b9937..50d1e95 100644
@@ -667,8 +667,8 @@ asmlinkage __visible void __init start_kernel(void)
        page_writeback_init();
        proc_root_init();
        nsfs_init();
-       cgroup_init();
        cpuset_init();
+       cgroup_init();
        taskstats_init_early();
        delayacct_init();
 
--
Quoted 2 lines

1.8.0.2

Thanks
Ming Lei

Acked-by on v1 1/1
#2 lore raw
In reply to Zefan Li
Quoted 11 lines · Zefan Li

Now we call ss->bind() in cgroup_init(), so cgroup_init() will call cpuset_bind() and then the latter will access top_cpuset's cpumask, which is NULL, because cpuset_init() is called after cgroup_init()

The simplest fix is to swap cgroup_init() and cpuset_init().

Cc Vladimir Davydov <[email protected]>
Fixes 295458e67284 ("cgroup: call cgroup_subsys->bind on cgroup subsys initialization")

Reported by: Ming Lei <[email protected]>

Thanks!

maintainer Applied
#3 lore raw
In reply to Zefan Li
Quoted 11 lines · Zefan Li

Now we call ss->bind() in cgroup_init(), so cgroup_init() will call cpuset_bind() and then the latter will access top_cpuset's cpumask, which is NULL, because cpuset_init() is called after cgroup_init()

The simplest fix is to swap cgroup_init() and cpuset_init().

Cc Vladimir Davydov <[email protected]>
Fixes 295458e67284 ("cgroup: call cgroup_subsys->bind on cgroup subsys initialization")

Reported by: Ming Lei <[email protected]>

Applied to cgroup/for-4.1.

Thanks.

Signature · 1 line
tejun