... and make is SLAB_PANIC instead of simulating it with BUG_ON() - the boot is not going to get to kernel threads, nevermind userland... Signed-off-by: Al Viro --- kernel/fork.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/fork.c b/kernel/fork.c index b1f3915d5f8e..ddd2558f9431 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -108,6 +108,7 @@ #include #include #include +#include #include #include @@ -422,7 +423,8 @@ static void free_thread_stack(struct task_struct *tsk) #else /* !(THREAD_SIZE >= PAGE_SIZE) */ -static struct kmem_cache *thread_stack_cache; +static struct kmem_cache_opaque __thread_stack_cache; +#define thread_stack_cache to_kmem_cache(&__thread_stack_cache) static void thread_stack_free_rcu(struct rcu_head *rh) { @@ -453,10 +455,10 @@ static void free_thread_stack(struct task_struct *tsk) void thread_stack_cache_init(void) { - thread_stack_cache = kmem_cache_create_usercopy("thread_stack", - THREAD_SIZE, THREAD_SIZE, 0, 0, + kmem_cache_setup_usercopy(thread_stack_cache, "thread_stack", + THREAD_SIZE, THREAD_SIZE, + SLAB_PANIC, 0, THREAD_SIZE, NULL); - BUG_ON(thread_stack_cache == NULL); } #endif /* THREAD_SIZE >= PAGE_SIZE */ -- 2.47.3