Skip to content

Replace module_init with an alternate initcall in non modules

Paul Gortmaker linux-arm-kernel linux-mm linuxppc-dev lkml netdev netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11mm: replace module_init usages with subsys_initcall in nommu.cmm/nommu.c+2 -20 replies
2/11fs/notify: don't use module_init for non-modular inotify_user codefs/notify/inotify/inotify_user.c+2 -20 replies
3/11netfilter: don't use module_init/exit in core IPV4 codenet/ipv4/netfilter.c+1 -82 replies
4/11x86: don't use module_init for non-modular core bootflag codearch/x86/kernel/bootflag.c+1 -10 replies
5/11powerpc: use subsys_initcall for Freescale Local Busarch/powerpc/sysdev/fsl_lbc.c+1 -10 replies
6/11powerpc: don't use module_init for non-modular core hugetlb codearch/powerpc/mm/hugetlbpage.c+1 -10 replies
7/11arm: use subsys_initcall in non-modular pl320 IPC codedrivers/mailbox/pl320-ipc.c+1 -10 replies
8/11lib/list_sort: use late_initcall to hook in self testslib/list_sort.c+1 -10 replies
9/11mm/page_owner.c: use late_initcall to hook in enablingmm/page_owner.c+1 -10 replies
10/11x86: perf_event_intel_bts.c: use arch_initcall to hook in enablingarch/x86/kernel/cpu/perf_event_intel_bts.c+1 -25 replies
11/11x86: perf_event_intel_pt.c: use arch_initcall to hook in enablingarch/x86/kernel/cpu/perf_event_intel_pt.c+1 -22 replies

Reviews trailers per patch

2 of 11 patches have a Reviewed-by or Acked-by.

PatchScott WoodPablo Neira Ayuso
1/11
2/11
3/11A-b
4/11
5/11A-b
6/11
7/11
8/11
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/11] Replace module_init with an alternate initcall in non modules

This series of commits converts non-modular code that is using the module_init() call to hook itself into the system to instead use one of the alternate priority initcalls.

Unlike the earlier series[1] that used device_initcall and hence was a runtime no-op, these commits change to one of the alternate initcalls, because (a) we have them and (b) it seems like the right thing to do. For example, it would seem logical to use arch_initcall for arch specific setup code and fs_initcall for filesystem setup code.

This does mean however, that changes in the init ordering will be taking place, and so there is a small risk that some kind of implicit init ordering issue may lie uncovered. But I think it is still better to give these ones sensible priorities than to just assign them all to device_initcall in order to exactly preserve the old ordering.

Thad said, we have already made similar changes in core kernel code in commit c96d6660dc65b0a90aea9834bfd8be1d5656da18 ("kernel: audit/fix non-modular users of module_init in core code") without any regressions reported, so this type of change isn't without precedent.

This work is factored out from what was a previously larger series[2] so that there is a common theme and lower patch count to ease review.

Paul.

[1] https://lkml.org/lkml/2015/5/28/809
[2] https://marc.info/?l=linux-kernel&m=139033951228828

---

Cc Andrew Morton <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Paris <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc John McCutchan <[email protected]>
Cc Jozsef Kadlecsik <[email protected]>
Cc Pablo Neira Ayuso <[email protected]>
Cc Patrick McHardy <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Robert Love <[email protected]>
Cc Russell King <[email protected]>
Cc Scott Wood <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc linux-mm at kvack.org
Cc linuxppc-dev at lists.ozlabs.org
Cc netdev at vger.kernel.org
Cc netfilter-devel at vger.kernel.org
Cc x86 at kernel.org

Paul Gortmaker (11):
mm: replace module_init usages with subsys_initcall in nommu.c fs/notify: don't use module_init for non-modular inotify_user code
netfilter: don't use module_init/exit in core IPV4 code
x86: don't use module_init for non-modular core bootflag code
powerpc: use subsys_initcall for Freescale Local Bus
powerpc: don't use module_init for non-modular core hugetlb code
arm: use subsys_initcall in non-modular pl320 IPC code lib/list_sort: use late_initcall to hook in self tests mm/page_owner.c: use late_initcall to hook in enabling
x86: perf_event_intel_bts.c: use arch_initcall to hook in enabling
x86: perf_event_intel_pt.c: use arch_initcall to hook in enabling

 arch/powerpc/mm/hugetlbpage.c              | 2 +-
 arch/powerpc/sysdev/fsl_lbc.c              | 2 +-
 arch/x86/kernel/bootflag.c                 | 2 +-
 arch/x86/kernel/cpu/perf_event_intel_bts.c | 3 +--
 arch/x86/kernel/cpu/perf_event_intel_pt.c  | 3 +--
 drivers/mailbox/pl320-ipc.c                | 2 +-
 fs/notify/inotify/inotify_user.c           | 4 ++--
 lib/list_sort.c                            | 2 +-
 mm/nommu.c                                 | 4 ++--
 mm/page_owner.c                            | 2 +-
 net/ipv4/netfilter.c                       | 9 +--------
 11 files changed, 13 insertions(+), 22 deletions(-)
Signature · 1 line
2.2.1