Page MenuHomeFreeBSD

Add options COMPACT to produce smaller kernel
AbandonedPublic

Authored by mjg on Nov 14 2020, 6:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 26 2024, 3:47 AM
Unknown Object (File)
Sep 8 2024, 2:10 AM
Unknown Object (File)
Sep 7 2024, 6:06 PM
Unknown Object (File)
Sep 7 2024, 9:03 AM
Unknown Object (File)
Aug 14 2024, 4:15 PM
Unknown Object (File)
Aug 9 2024, 5:38 PM
Unknown Object (File)
Aug 9 2024, 2:27 AM
Unknown Object (File)
Aug 7 2024, 9:35 PM
Subscribers

Details

Reviewers
kib
markj
Summary

This adds __aligned_if_not_compact and converts __exclusive_cache_line to use it. It retains the section annotation, I may whack it.

I'm not interested in arguing about the name, propose something else and I'll rename. Alternatively, write your own patch and I'll use it in D27185

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 34797

Event Timeline

mjg requested review of this revision.Nov 14 2020, 6:51 PM
sys/conf/options
1019

Not specifying file name means that option is stored in opt_compact.h, but you never include it.

I strongly suggest putting it in opt_global.h.

sys/sys/cdefs.h
244

This header is also used for userspace, and COMPACT is clearly is in user namespace.
Perhaps we need to use protected name for the option, like __COMPACT.

sys/sys/cdefs.h
244

so that would be __COMPACT put in the config? Looks like some form of prefixing would be warranted for cases like this.

I don't think the COMPACT option (with whatever name) is worth introducing at this time if it goes beyond the few lines (+ fixups) I posted here.

sys/sys/cdefs.h
244

I think it should go somewhere in systm.h or similar. Then it could be COMPACT without prefix.

I do think that COMPAT is worth it, even if such small for now. It is first step, and I expect that it will be taken from this quite fast. It is long overdue.

So put together the following. This runs into further issues as users have to explicitly include opt_global to get the macro, so I think this is just too error prone in this form.

That said, I don't intend to work on this any further. If you want to see this option in you will have to take over or get someone else to do it.

This looks fine to me as the first step.

There is no need to manually include opt_global.h, it is automatically pre-included by the build infrastructure: -include /usr/home/kostik/work/DEV/src/sys/amd64/compile/GENERIC/opt_global.h.

I wonder how much more can we pack in the first commit, e.g. mtx_padalign can be converted to __aligned_if_not_compact.

sys/sys/systm.h
159

Are there uses for 'x' or is x always CACHE_LINE_SIZE, for practical purposes ?