@@ -3015,10 +3015,27 @@ static void sighand_ctor(void *data)
3015
3015
init_waitqueue_head (& sighand -> signalfd_wqh );
3016
3016
}
3017
3017
3018
- void __init proc_caches_init (void )
3018
+ void __init mm_cache_init (void )
3019
3019
{
3020
3020
unsigned int mm_size ;
3021
3021
3022
+ /*
3023
+ * The mm_cpumask is located at the end of mm_struct, and is
3024
+ * dynamically sized based on the maximum CPU number this system
3025
+ * can have, taking hotplug into account (nr_cpu_ids).
3026
+ */
3027
+ mm_size = sizeof (struct mm_struct ) + cpumask_size ();
3028
+
3029
+ mm_cachep = kmem_cache_create_usercopy ("mm_struct" ,
3030
+ mm_size , ARCH_MIN_MMSTRUCT_ALIGN ,
3031
+ SLAB_HWCACHE_ALIGN |SLAB_PANIC |SLAB_ACCOUNT ,
3032
+ offsetof(struct mm_struct , saved_auxv ),
3033
+ sizeof_field (struct mm_struct , saved_auxv ),
3034
+ NULL );
3035
+ }
3036
+
3037
+ void __init proc_caches_init (void )
3038
+ {
3022
3039
sighand_cachep = kmem_cache_create ("sighand_cache" ,
3023
3040
sizeof (struct sighand_struct ), 0 ,
3024
3041
SLAB_HWCACHE_ALIGN |SLAB_PANIC |SLAB_TYPESAFE_BY_RCU |
@@ -3036,19 +3053,6 @@ void __init proc_caches_init(void)
3036
3053
SLAB_HWCACHE_ALIGN |SLAB_PANIC |SLAB_ACCOUNT ,
3037
3054
NULL );
3038
3055
3039
- /*
3040
- * The mm_cpumask is located at the end of mm_struct, and is
3041
- * dynamically sized based on the maximum CPU number this system
3042
- * can have, taking hotplug into account (nr_cpu_ids).
3043
- */
3044
- mm_size = sizeof (struct mm_struct ) + cpumask_size ();
3045
-
3046
- mm_cachep = kmem_cache_create_usercopy ("mm_struct" ,
3047
- mm_size , ARCH_MIN_MMSTRUCT_ALIGN ,
3048
- SLAB_HWCACHE_ALIGN |SLAB_PANIC |SLAB_ACCOUNT ,
3049
- offsetof(struct mm_struct , saved_auxv ),
3050
- sizeof_field (struct mm_struct , saved_auxv ),
3051
- NULL );
3052
3056
vm_area_cachep = KMEM_CACHE (vm_area_struct , SLAB_PANIC |SLAB_ACCOUNT );
3053
3057
mmap_init ();
3054
3058
nsproxy_cache_init ();
0 commit comments