Page MenuHomeFreeBSD

Don't define KLD_MODULE when build module with kernel
Needs ReviewPublic

Authored by howard0su_gmail.com on Apr 19 2016, 3:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 29, 2:38 AM
Unknown Object (File)
Sun, Jun 22, 1:12 AM
Unknown Object (File)
Tue, Jun 17, 8:13 AM
Unknown Object (File)
Wed, Jun 11, 6:58 AM
Unknown Object (File)
May 29 2025, 8:32 PM
Unknown Object (File)
May 28 2025, 8:28 PM
Unknown Object (File)
May 27 2025, 7:25 PM
Unknown Object (File)
Apr 14 2025, 6:33 PM
Subscribers

Details

Reviewers
jhb
Summary

This remove the extra overhead when defining KLD_MODULE. The
performance gains from inline atomic(9) and mutex(9) functions.
However the modules built with kernel is not supposed to be used
with other kernel. In practical, this is unlikely happen.

The behavior of building a module standalone is not changed. This
maintain the compactibility for the out-of-tree modules as before.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3321
Build 3356: arc lint + arc unit

Event Timeline

howard0su_gmail.com retitled this revision from to Don't define KLD_MODULE when build module with kernel.
howard0su_gmail.com updated this object.
howard0su_gmail.com edited the test plan for this revision. (Show Details)
howard0su_gmail.com added a reviewer: jhb.

I tried a variant of this recently and it actually broke several things as there are some places that use KLD_MODULE for behavior that needs to be different even for modules tied to the kernel. I will perhaps add a new KLD_GENERIC_MODULE and replace some of the KLD_MODULE tests with that instead.