<p dir="ltr"><br>
On Feb 4, 2014 3:52 PM, "Paul Gortmaker" <<a href="mailto:paul.gortmaker@windriver.com">paul.gortmaker@windriver.com</a>> wrote:<br>
><br>
> We've had this in linux-next for 2+ weeks (thanks Stephen!) as a<br>
> linux-stable like queue of patches, and as can be seen here:<br>
><br>
> <a href="https://git.kernel.org/pub/scm/linux/kernel/git/paulg/init.git">https://git.kernel.org/pub/scm/linux/kernel/git/paulg/init.git</a></p>
<p dir="ltr">Argh, above link is meant for cloning, not viewing.</p>
<p dir="ltr">This should be better...</p>
<p dir="ltr"><a href="https://git.kernel.org/cgit/linux/kernel/git/paulg/init.git/">https://git.kernel.org/cgit/linux/kernel/git/paulg/init.git/</a></p>
<p dir="ltr">Thanks,<br>
Paul.<br>
--<br></p>
<p dir="ltr">> most of the changes in the last week have been trivial adding acks<br>
> or dropping patches that maintainers decided to take themselves.<br>
><br>
> With -rc1 now containing what was in linux-next, the queue applies<br>
> to that baseline w/o issue, and I've redone comprehensive multi<br>
> arch build testing on the -rc1 baseline as a final sanity check.<br>
><br>
> Original RFC discussion and patch posting is here, if needed:<br>
><br>
> <a href="https://lkml.org/lkml/2014/1/21/434">https://lkml.org/lkml/2014/1/21/434</a><br>
><br>
> Suggested merge text follows:<br>
><br>
> ----------------------------8<-----------------------------<br>
> Summary - We removed cpuinit and devinit, which left ~2000 instances<br>
> of include <linux/init.h> that were no longer needed. To fully enable<br>
> this removal/cleanup, we relocate module_init() from init.h into<br>
> module.h. Multi arch/multi config build testing on linux-next has<br>
> been used to find and fix any implicit header dependencies prior to<br>
> deploying the actual init.h --> module.h move, to preserve bisection.<br>
><br>
> Additional details:<br>
><br>
> module_init/module_exit and friends moved to module.h<br>
> -----------------------------------------------------<br>
> Aside from enabling this init.h cleanup to extend into modular files,<br>
> it actually does make sense. For all modules will use some form of<br>
> our initfunc processing/categorization, but not all initfunc users<br>
> will be necessarily using modular functionality. So we move these<br>
> module related macros to module.h and ensure module.h sources init.h<br>
><br>
><br>
> module_init in non modular code:<br>
> --------------------------------<br>
> This series uncovered that we are enabling people to use module_init<br>
> in non-modular code. While that works fine, there are at least three<br>
> reasons why it probably should not be encouraged:<br>
><br>
> 1) it makes a casual reader of the code assume the code is modular<br>
> even though it is obj-y (builtin) or controlled by a bool Kconfig.<br>
><br>
> 2) it makes it too easy to add dead code in a function that is handed<br>
> to module_exit() -- [more on that below]<br>
><br>
> 3) it breaks our ability to use priority sorted initcalls properly<br>
> [more on that below.]<br>
><br>
> 4) on some files, the use of module.h vs. init.h can cost a ~10%<br>
> increase in the number of lines output from CPP.<br>
><br>
> After this change, a new coder who tries to make use of module_init in<br>
> non modular code would find themselves also needing to include the<br>
> module.h header. At which point the odds are greater that they would<br>
> ask themselves "Am I doing this right? I shouldn't need this."<br>
><br>
> Note that existing non-modular code that already includes module.h and<br>
> uses module_init doesn't get fixed here, since they already build w/o<br>
> errors triggered by this change; we'll have to hunt them down later.<br>
><br>
><br>
> module_init and initcall ordering:<br>
> ----------------------------------<br>
> We have a group of about ten priority sorted initcalls, that are<br>
> called in init/main.c after most of the hard coded/direct calls<br>
> have been processed. These serve the purpose of avoiding everyone<br>
> poking at init/main.c to hook in their init sequence. The bins are:<br>
><br>
> pure_initcall 0<br>
> core_initcall 1<br>
> postcore_initcall 2<br>
> arch_initcall 3<br>
> subsys_initcall 4<br>
> fs_initcall 5<br>
> device_initcall 6<br>
> late_initcall 7<br>
><br>
> These are meant to eventually replace users of the non specific<br>
> priority "__initcall" which currently maps onto device_initcall.<br>
> This is of interest, because in non-modular code, cpp does this:<br>
><br>
> module_init --> __initcall --> device_initcall<br>
><br>
> So all module_init() land in the device_initcall bucket, rather late<br>
> in the sequence. That makes sense, since if it was a module, the init<br>
> could be real late (days, weeks after boot). But now imagine you add<br>
> support for some non-modular bus/arch/infrastructure (say for e.g. PCI)<br>
> and you use module_init for it. That means anybody else who wants<br>
> to use your subsystem can't do so if they use an initcall of 0 --> 5<br>
> priority. For a real world example of this, see patch #1 in this series:<br>
><br>
> <a href="https://lkml.org/lkml/2014/1/14/809">https://lkml.org/lkml/2014/1/14/809</a><br>
><br>
> We don't want to force code that is clearly arch or subsys or fs<br>
> specific to have to use the device_initcall just because something<br>
> else has been mistakenly put (or left) in that bucket. So a couple of<br>
> changes do actually change the initcall level where it is inevitably<br>
> appropriate to do so. Those are called out explicitly in their<br>
> respective commit logs.<br>
><br>
><br>
> module_exit and dead code<br>
> -------------------------<br>
> Built in code will never have an opportunity to call functions that<br>
> are registered with module_exit(), so any cases of that uncovered in<br>
> this series delete that dead code. Note that any built-in code that<br>
> was already including module.h and using module_exit won't have shown<br>
> up as breakage on the build coverage of this series, so we'll have to<br>
> find those independently later. It looks like there may be quite a<br>
> few that are invisibly created via module_platform_driver -- a macro<br>
> that creates module_init and module_exit automatically. We may want<br>
> to consider relocating module_platform_driver into module.h later...<br>
><br>
><br>
> cpuinit<br>
> -------<br>
> To finalize the removal of cpuinit, which was done several releases<br>
> ago, we remove the remaining stub functions from init.h in this<br>
> series. We've seen one or two "users" try to creep back in, so this<br>
> will close the door on that chapter and prevent creep.<br>
><br>
> ----------------------------8<-----------------------------<br>
><br>
> Thanks,<br>
> Paul.<br>
> ---<br>
><br>
> Cc: <a href="mailto:linux-alpha@vger.kernel.org">linux-alpha@vger.kernel.org</a><br>
> Cc: <a href="mailto:linux-arch@vger.kernel.org">linux-arch@vger.kernel.org</a><br>
> Cc: <a href="mailto:linux-arm-kernel@lists.infradead.org">linux-arm-kernel@lists.infradead.org</a><br>
> Cc: <a href="mailto:linux-ia64@vger.kernel.org">linux-ia64@vger.kernel.org</a><br>
> Cc: <a href="mailto:linux-m68k@lists.linux-m68k.org">linux-m68k@lists.linux-m68k.org</a><br>
> Cc: <a href="mailto:linux-mips@linux-mips.org">linux-mips@linux-mips.org</a><br>
> Cc: <a href="mailto:linuxppc-dev@lists.ozlabs.org">linuxppc-dev@lists.ozlabs.org</a><br>
> Cc: <a href="mailto:linux-s390@vger.kernel.org">linux-s390@vger.kernel.org</a><br>
> Cc: <a href="mailto:sparclinux@vger.kernel.org">sparclinux@vger.kernel.org</a><br>
> Cc: <a href="mailto:x86@kernel.org">x86@kernel.org</a><br>
> Cc: <a href="mailto:netdev@vger.kernel.org">netdev@vger.kernel.org</a><br>
> Cc: <a href="mailto:kvm@vger.kernel.org">kvm@vger.kernel.org</a><br>
> Cc: <a href="mailto:sfr@canb.auug.org.au">sfr@canb.auug.org.au</a><br>
> Cc: <a href="mailto:rusty@rustcorp.com.au">rusty@rustcorp.com.au</a><br>
> Cc: <a href="mailto:gregkh@linuxfoundation.org">gregkh@linuxfoundation.org</a><br>
> Cc: <a href="mailto:akpm@linux-foundation.org">akpm@linux-foundation.org</a><br>
> Cc: <a href="mailto:torvalds@linux-foundation.org">torvalds@linux-foundation.org</a><br>
><br>
><br>
> The following changes since commit 38dbfb59d1175ef458d006556061adeaa8751b72:<br>
><br>
> Linus 3.14-rc1 (2014-02-02 16:42:13 -0800)<br>
><br>
> are available in the git repository at:<br>
><br>
> git://<a href="http://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux.git">git.kernel.org/pub/scm/linux/kernel/git/paulg/linux.git</a> tags/init-cleanup<br>
><br>
> for you to fetch changes up to a830e2e2777c893e5bfdaa370d6375023e8cd2a5:<br>
><br>
> include: remove needless instances of <linux/init.h> (2014-02-03 16:39:14 -0500)<br>
><br>
> ----------------------------------------------------------------<br>
> Cleanup of <linux/init.h> for 3.14-rc1<br>
><br>
> ----------------------------------------------------------------<br>
> Paul Gortmaker (77):<br>
> init: delete the __cpuinit related stubs<br>
> kernel: audit/fix non-modular users of module_init in core code<br>
> mm: replace module_init usages with subsys_initcall in nommu.c<br>
> fs/notify: don't use module_init for non-modular inotify_user code<br>
> netfilter: don't use module_init/exit in core IPV4 code<br>
> x86: don't use module_init in non-modular intel_mid_vrtc.c<br>
> x86: don't use module_init for non-modular core bootflag code<br>
> x86: replace __init_or_module with __init in non-modular vsmp_64.c<br>
> x86: don't use module_init in non-modular devicetree.c code<br>
> drivers/tty/hvc: don't use module_init in non-modular hyp. console code<br>
> staging: don't use module_init in non-modular ion_dummy_driver.c<br>
> powerpc: use device_initcall for registering rtc devices<br>
> powerpc: use subsys_initcall for Freescale Local Bus<br>
> powerpc: don't use module_init for non-modular core hugetlb code<br>
> powerpc: don't use module_init in non-modular 83xx suspend code<br>
> arm: include module.h in drivers/bus/omap_l3_smx.c<br>
> arm: fix implicit module.h use in mach-at91 gpio.h<br>
> arm: fix implicit #include <linux/init.h> in entry asm.<br>
> arm: mach-s3c64xx mach-crag6410-module.c is not modular<br>
> arm: use subsys_initcall in non-modular pl320 IPC code<br>
> arm: don't use module_init in non-modular mach-vexpress/spc.c code<br>
> alpha: don't use module_init for non-modular core code<br>
> m68k: don't use module_init in non-modular mvme16x/rtc.c code<br>
> ia64: don't use module_init for non-modular core kernel/mca.c code<br>
> ia64: don't use module_init in non-modular sim/simscsi.c code<br>
> mips: make loongsoon serial driver explicitly modular<br>
> mips: don't use module_init in non-modular sead3-mtd.c code<br>
> cris: don't use module_init for non-modular core intmem.c code<br>
> parisc: don't use module_init for non-modular core pdc_cons code<br>
> parisc64: don't use module_init for non-modular core perf code<br>
> mn10300: don't use module_init in non-modular flash.c code<br>
> sh: don't use module_init in non-modular psw.c code<br>
> sh: mach-highlander/psw.c is tristate and should use module.h<br>
> xtensa: don't use module_init for non-modular core network.c code<br>
> drivers/clk: don't use module_init in clk-nomadik.c which is non-modular<br>
> cpuidle: don't use modular platform register in non-modular ARM drivers<br>
> drivers/platform: don't use modular register in non-modular pdev_bus.c<br>
> module: relocate module_init from init.h to module.h<br>
> logo: emit "#include <linux/init.h> in autogenerated C file<br>
> arm: delete non-required instances of include <linux/init.h><br>
> mips: restore init.h usage to arch/mips/ar7/time.c<br>
> s390: delete non-required instances of include <linux/init.h><br>
> alpha: delete non-required instances of <linux/init.h><br>
> powerpc: delete another unrequired instance of <linux/init.h><br>
> arm64: delete non-required instances of <linux/init.h><br>
> watchdog: delete non-required instances of include <linux/init.h><br>
> video: delete non-required instances of include <linux/init.h><br>
> rtc: delete non-required instances of include <linux/init.h><br>
> scsi: delete non-required instances of include <linux/init.h><br>
> spi: delete non-required instances of include <linux/init.h><br>
> acpi: delete non-required instances of include <linux/init.h><br>
> drivers/power: delete non-required instances of include <linux/init.h><br>
> drivers/media: delete non-required instances of include <linux/init.h><br>
> drivers/ata: delete non-required instances of include <linux/init.h><br>
> drivers/hwmon: delete non-required instances of include <linux/init.h><br>
> drivers/pinctrl: delete non-required instances of include <linux/init.h><br>
> drivers/isdn: delete non-required instances of include <linux/init.h><br>
> drivers/leds: delete non-required instances of include <linux/init.h><br>
> drivers/pcmcia: delete non-required instances of include <linux/init.h><br>
> drivers/char: delete non-required instances of include <linux/init.h><br>
> drivers/infiniband: delete non-required instances of include <linux/init.h><br>
> drivers/mfd: delete non-required instances of include <linux/init.h><br>
> drivers/gpio: delete non-required instances of include <linux/init.h><br>
> drivers/bluetooth: delete non-required instances of include <linux/init.h><br>
> drivers/mmc: delete non-required instances of include <linux/init.h><br>
> drivers/crypto: delete non-required instances of include <linux/init.h><br>
> drivers/platform: delete non-required instances of include <linux/init.h><br>
> drivers/misc: delete non-required instances of include <linux/init.h><br>
> drivers/edac: delete non-required instances of include <linux/init.h><br>
> drivers/macintosh: delete non-required instances of include <linux/init.h><br>
> drivers/base: delete non-required instances of include <linux/init.h><br>
> drivers/cpufreq: delete non-required instances of <linux/init.h><br>
> drivers/pci: delete non-required instances of <linux/init.h><br>
> drivers/dma: delete non-required instances of <linux/init.h><br>
> drivers/gpu: delete non-required instances of <linux/init.h><br>
> drivers: delete remaining non-required instances of <linux/init.h><br>
> include: remove needless instances of <linux/init.h><br>
><br>
> arch/alpha/kernel/err_ev6.c | 1 -<br>
> arch/alpha/kernel/irq.c | 1 -<br>
> arch/alpha/kernel/srmcons.c | 3 +-<br>
> arch/alpha/kernel/traps.c | 1 -<br>
> arch/alpha/oprofile/op_model_ev4.c | 1 -<br>
> arch/alpha/oprofile/op_model_ev5.c | 1 -<br>
> arch/alpha/oprofile/op_model_ev6.c | 1 -<br>
> arch/alpha/oprofile/op_model_ev67.c | 1 -<br>
> arch/arm/common/dmabounce.c | 1 -<br>
> arch/arm/firmware/trusted_foundations.c | 1 -<br>
> arch/arm/include/asm/arch_timer.h | 1 -<br>
> arch/arm/kernel/entry-armv.S | 2 +<br>
> arch/arm/kernel/entry-header.S | 1 -<br>
> arch/arm/kernel/hyp-stub.S | 1 -<br>
> arch/arm/kernel/suspend.c | 1 -<br>
> arch/arm/kernel/unwind.c | 1 -<br>
> arch/arm/mach-at91/include/mach/gpio.h | 1 +<br>
> arch/arm/mach-cns3xxx/pm.c | 1 -<br>
> arch/arm/mach-exynos/headsmp.S | 1 -<br>
> arch/arm/mach-footbridge/personal.c | 1 -<br>
> arch/arm/mach-imx/headsmp.S | 1 -<br>
> arch/arm/mach-imx/iomux-v3.c | 1 -<br>
> arch/arm/mach-iop33x/uart.c | 1 -<br>
> arch/arm/mach-msm/headsmp.S | 1 -<br>
> arch/arm/mach-msm/proc_comm.h | 1 -<br>
> arch/arm/mach-mvebu/headsmp.S | 1 -<br>
> arch/arm/mach-netx/fb.c | 1 -<br>
> arch/arm/mach-netx/pfifo.c | 1 -<br>
> arch/arm/mach-netx/xc.c | 1 -<br>
> arch/arm/mach-nspire/clcd.c | 1 -<br>
> arch/arm/mach-omap1/fpga.c | 1 -<br>
> arch/arm/mach-omap1/include/mach/serial.h | 1 -<br>
> arch/arm/mach-omap2/omap-headsmp.S | 1 -<br>
> arch/arm/mach-omap2/omap3-restart.c | 1 -<br>
> arch/arm/mach-omap2/vc3xxx_data.c | 1 -<br>
> arch/arm/mach-omap2/vc44xx_data.c | 1 -<br>
> arch/arm/mach-omap2/vp3xxx_data.c | 1 -<br>
> arch/arm/mach-omap2/vp44xx_data.c | 1 -<br>
> arch/arm/mach-prima2/headsmp.S | 1 -<br>
> arch/arm/mach-pxa/clock-pxa2xx.c | 1 -<br>
> arch/arm/mach-pxa/clock-pxa3xx.c | 1 -<br>
> arch/arm/mach-pxa/corgi_pm.c | 1 -<br>
> arch/arm/mach-pxa/mfp-pxa3xx.c | 1 -<br>
> arch/arm/mach-pxa/spitz_pm.c | 1 -<br>
> arch/arm/mach-s3c24xx/clock-s3c244x.c | 1 -<br>
> arch/arm/mach-s3c24xx/iotiming-s3c2410.c | 1 -<br>
> arch/arm/mach-s3c24xx/iotiming-s3c2412.c | 1 -<br>
> arch/arm/mach-s3c24xx/irq-pm.c | 1 -<br>
> arch/arm/mach-s3c24xx/pm.c | 1 -<br>
> arch/arm/mach-s3c64xx/mach-crag6410-module.c | 2 +-<br>
> arch/arm/mach-s5p64x0/clock.c | 1 -<br>
> arch/arm/mach-sa1100/ssp.c | 1 -<br>
> arch/arm/mach-shmobile/headsmp-scu.S | 1 -<br>
> arch/arm/mach-shmobile/headsmp.S | 1 -<br>
> arch/arm/mach-shmobile/platsmp.c | 1 -<br>
> arch/arm/mach-shmobile/sleep-sh7372.S | 1 -<br>
> arch/arm/mach-socfpga/headsmp.S | 1 -<br>
> arch/arm/mach-sti/headsmp.S | 1 -<br>
> arch/arm/mach-sunxi/headsmp.S | 1 -<br>
> arch/arm/mach-tegra/flowctrl.c | 1 -<br>
> arch/arm/mach-tegra/headsmp.S | 1 -<br>
> arch/arm/mach-tegra/reset-handler.S | 1 -<br>
> arch/arm/mach-u300/dummyspichip.c | 1 -<br>
> arch/arm/mach-ux500/board-mop500-audio.c | 1 -<br>
> arch/arm/mach-ux500/headsmp.S | 1 -<br>
> arch/arm/mach-versatile/versatile_ab.c | 1 -<br>
> arch/arm/mach-vexpress/spc.c | 2 +-<br>
> arch/arm/mach-zynq/headsmp.S | 1 -<br>
> arch/arm/mm/hugetlbpage.c | 1 -<br>
> arch/arm/plat-iop/i2c.c | 1 -<br>
> arch/arm/plat-samsung/pm-check.c | 1 -<br>
> arch/arm/plat-samsung/pm-gpio.c | 1 -<br>
> arch/arm/plat-samsung/s5p-irq-pm.c | 1 -<br>
> arch/arm/plat-versatile/headsmp.S | 1 -<br>
> arch/arm/plat-versatile/platsmp.c | 1 -<br>
> arch/arm/vfp/entry.S | 2 +<br>
> arch/arm64/include/asm/arch_timer.h | 1 -<br>
> arch/arm64/kernel/cputable.c | 2 -<br>
> arch/arm64/kernel/entry.S | 1 -<br>
> arch/arm64/kernel/hyp-stub.S | 1 -<br>
> arch/arm64/kernel/process.c | 1 -<br>
> arch/arm64/kernel/ptrace.c | 1 -<br>
> arch/arm64/kernel/smp_spin_table.c | 1 -<br>
> arch/arm64/kernel/vdso/vdso.S | 1 -<br>
> arch/arm64/lib/delay.c | 1 -<br>
> arch/arm64/mm/cache.S | 1 -<br>
> arch/arm64/mm/proc.S | 1 -<br>
> arch/cris/arch-v32/mm/intmem.c | 3 +-<br>
> arch/ia64/hp/sim/simscsi.c | 11 +---<br>
> arch/ia64/sn/kernel/mca.c | 3 +-<br>
> arch/m68k/mvme16x/rtc.c | 2 +-<br>
> arch/mips/ar7/time.c | 1 +<br>
> arch/mips/loongson/common/serial.c | 9 ++-<br>
> arch/mips/mti-sead3/sead3-mtd.c | 3 +-<br>
> arch/mn10300/unit-asb2303/flash.c | 3 +-<br>
> arch/parisc/kernel/pdc_cons.c | 3 +-<br>
> arch/parisc/kernel/perf.c | 3 +-<br>
> arch/powerpc/kernel/time.c | 2 +-<br>
> arch/powerpc/mm/hugetlbpage.c | 2 +-<br>
> arch/powerpc/platforms/83xx/suspend.c | 3 +-<br>
> arch/powerpc/platforms/ps3/time.c | 3 +-<br>
> arch/powerpc/sysdev/fsl_lbc.c | 2 +-<br>
> arch/powerpc/sysdev/indirect_pci.c | 1 -<br>
> arch/sh/boards/mach-highlander/psw.c | 2 +-<br>
> arch/sh/boards/mach-landisk/psw.c | 2 +-<br>
> arch/x86/kernel/bootflag.c | 2 +-<br>
> arch/x86/kernel/devicetree.c | 2 +-<br>
> arch/x86/kernel/vsmp_64.c | 2 +-<br>
> arch/x86/platform/intel-mid/intel_mid_vrtc.c | 3 +-<br>
> arch/xtensa/platforms/iss/network.c | 4 +-<br>
> drivers/acpi/apei/apei-base.c | 1 -<br>
> drivers/acpi/button.c | 1 -<br>
><br>
> [ ... snip ~1000 lines of trivial driver diffstat ... ]<br>
><br>
> drivers/watchdog/wdt_pci.c | 1 -<br>
> drivers/xen/xen-stub.c | 1 -<br>
> fs/notify/inotify/inotify_user.c | 4 +-<br>
> include/drm/drmP.h | 1 -<br>
> include/linux/fb.h | 1 -<br>
> include/linux/ide.h | 1 -<br>
> include/linux/init.h | 77 ----------------------<br>
> include/linux/kdb.h | 1 -<br>
> include/linux/linux_logo.h | 3 -<br>
> include/linux/lsm_audit.h | 1 -<br>
> include/linux/module.h | 72 ++++++++++++++++++++<br>
> include/linux/moduleparam.h | 1 -<br>
> include/linux/netfilter.h | 1 -<br>
> include/linux/nls.h | 2 +-<br>
> include/linux/percpu_ida.h | 1 -<br>
> include/linux/profile.h | 1 -<br>
> include/linux/pstore_ram.h | 1 -<br>
> include/linux/usb/gadget.h | 1 -<br>
> include/xen/xenbus.h | 1 -<br>
> kernel/hung_task.c | 3 +-<br>
> kernel/kexec.c | 4 +-<br>
> kernel/profile.c | 2 +-<br>
> kernel/sched/stats.c | 2 +-<br>
> kernel/user.c | 3 +-<br>
> kernel/user_namespace.c | 2 +-<br>
> mm/nommu.c | 4 +-<br>
> net/ipv4/netfilter.c | 9 +--<br>
> scripts/pnmtologo.c | 1 +<br>
> scripts/tags.sh | 2 +-<br>
> 1115 files changed, 148 insertions(+), 1273 deletions(-)<br>
><br>
</p>