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