Bug 205217

Summary: Consider putting KUnit in __init sections
Product: Tools Reporter: Brendan Higgins (brendanhiggins)
Component: KUnitAssignee: Tools/KUnit virtual default assignee (tools_kunit)
Status: RESOLVED WILL_NOT_FIX    
Severity: enhancement CC: brendanhiggins, davidgow
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: kselftest/test (5.4) Tree: Mainline
Regression: No

Description Brendan Higgins 2019-10-16 20:44:53 UTC
(Paraphrased from Andrew Morton) Given that everything runs at late_initcall time, we may want to put all the KUnit code (core and tests) in __init, __initdata etc so all the code and data doesn't hang around forever?

It is worth pointing out that we are considering allowing at least some tests to be made into loadable modules that will be run after the kernel is booted.
Comment 1 Brendan Higgins 2019-10-16 20:47:43 UTC
Note: The original discussion can be found here: https://lore.kernel.org/linux-kselftest/20191011140536.03c3e25500b31ddcfa0f542b@linux-foundation.org/
Comment 2 Brendan Higgins 2020-02-12 18:39:09 UTC
KUnit no longer runs strictly in late_init: It now has module support, and there is ongoing work to make it run at arbitrary points in time via debugfs.