Subject: + mm-make-creation-of-the-mm_kobj-happen-earlier-than-device_initcall.patch added to -mm tree To: paul.gortmaker@xxxxxxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Tue, 14 Jan 2014 15:55:31 -0800 The patch titled Subject: mm/mm_init.c: make creation of the mm_kobj happen earlier than device_initcall has been added to the -mm tree. Its filename is mm-make-creation-of-the-mm_kobj-happen-earlier-than-device_initcall.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-make-creation-of-the-mm_kobj-happen-earlier-than-device_initcall.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-make-creation-of-the-mm_kobj-happen-earlier-than-device_initcall.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Paul Gortmaker <paul.gortmaker@xxxxxxxxxxxxx> Subject: mm/mm_init.c: make creation of the mm_kobj happen earlier than device_initcall The use of __initcall is to be eventually replaced by choosing one from the prioritized groupings laid out in init.h header: pure_initcall 0 core_initcall 1 postcore_initcall 2 arch_initcall 3 subsys_initcall 4 fs_initcall 5 device_initcall 6 late_initcall 7 In the interim, all __initcall are mapped onto device_initcall, which as can be seen above, comes quite late in the ordering. Currently the mm_kobj is created with __initcall in mm_sysfs_init(). This means that any other initcalls that want to reference the mm_kobj have to be device_initcall (or later), otherwise we will for example, trip the BUG_ON(!kobj) in sysfs's internal_create_group(). This unfairly restricts those users; for example something that clearly makes sense to be an arch_initcall will not be able to choose that. However, upon examination, it is only this way for historical reasons (i.e. simply not reprioritized yet). We see that sysfs is ready quite earlier in init/main.c via: vfs_caches_init |_ mnt_init |_ sysfs_init well ahead of the processing of the prioritized calls listed above. So we can recategorize mm_sysfs_init to be a pure_initcall, which in turn allows any mm_kobj initcall users a wider range (1 --> 7) of initcall priorities to choose from. Signed-off-by: Paul Gortmaker <paul.gortmaker@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/mm_init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff -puN mm/mm_init.c~mm-make-creation-of-the-mm_kobj-happen-earlier-than-device_initcall mm/mm_init.c --- a/mm/mm_init.c~mm-make-creation-of-the-mm_kobj-happen-earlier-than-device_initcall +++ a/mm/mm_init.c @@ -202,5 +202,4 @@ static int __init mm_sysfs_init(void) return 0; } - -__initcall(mm_sysfs_init); +pure_initcall(mm_sysfs_init); _ Patches currently in -mm which might be from paul.gortmaker@xxxxxxxxxxxxx are lib-percpu_counterc-fix-__percpu_counter_add.patch fs-ramfs-dont-use-module_init-for-non-modular-core-code.patch mm-make-creation-of-the-mm_kobj-happen-earlier-than-device_initcall.patch printk-flush-conflicting-continuation-line.patch printk-flush-conflicting-continuation-line-fix.patch fs-proc-dont-use-module_init-for-non-modular-core-code.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html