]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - kernel/fork.c
x86/fpu, sched: Dynamically allocate 'struct fpu'
[karo-tx-linux.git] / kernel / fork.c
index 1bfefc6f96a4ea92507741cf1e935c6dab04c2b1..431b67a6098ca5907e2a2d27a3ec88ce77bd48be 100644 (file)
@@ -287,15 +287,21 @@ static void set_max_threads(unsigned int max_threads_suggested)
        max_threads = clamp_t(u64, threads, MIN_THREADS, MAX_THREADS);
 }
 
+int __weak arch_task_struct_size(void)
+{
+       return sizeof(struct task_struct);
+}
+
 void __init fork_init(void)
 {
+       int task_struct_size = arch_task_struct_size();
 #ifndef CONFIG_ARCH_TASK_STRUCT_ALLOCATOR
 #ifndef ARCH_MIN_TASKALIGN
 #define ARCH_MIN_TASKALIGN     L1_CACHE_BYTES
 #endif
        /* create a slab on which task_structs can be allocated */
        task_struct_cachep =
-               kmem_cache_create("task_struct", sizeof(struct task_struct),
+               kmem_cache_create("task_struct", task_struct_size,
                        ARCH_MIN_TASKALIGN, SLAB_PANIC | SLAB_NOTRACK, NULL);
 #endif