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.

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 OK
Unit
No Unit 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.