Page MenuHomeFreeBSD

Add COMPAT_FREEBSD11 and use it vm_meter.c.
ClosedPublic

Authored by markj on Dec 8 2016, 10:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 15, 12:49 AM
Unknown Object (File)
Wed, Nov 6, 12:37 PM
Unknown Object (File)
Wed, Oct 30, 11:57 AM
Unknown Object (File)
Oct 2 2024, 7:09 AM
Unknown Object (File)
Sep 11 2024, 8:21 PM
Unknown Object (File)
Sep 11 2024, 1:13 AM
Unknown Object (File)
Sep 8 2024, 2:31 PM
Unknown Object (File)
Sep 7 2024, 4:47 AM
Subscribers

Details

Summary

COMPAT_FREEBSD11 was added to all configs containing COMPAT_FREEBSD10.

The vm_meter.c change will be committed separately.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj retitled this revision from to Add COMPAT_FREEBSD11 and use it vm_meter.c..
markj edited the test plan for this revision. (Show Details)
markj updated this object.
markj edited edge metadata.
This revision is now accepted and ready to land.Dec 8 2016, 11:05 PM
imp added a reviewer: imp.
rstone added inline comments.
sys/vm/vm_meter.c
318 ↗(On Diff #22768)

should this be if defined(COMPAT_FREEBSD11) || defined(COMPAT_FREEBSD10) ...?

I'm not sure if anybody would intentionally have COMPAT_FREEBSD10 but not COMPAT_FREEBSD11, so this may be a rather hypothetical concern.

sys/vm/vm_meter.c
318 ↗(On Diff #22768)

There's always an implicit dependency of COMPAT_FREEBSD<n> on COMPAT_FREEBSD<n+1>, though in this case there's obviously no actual dependency. It'd be nice if config(8) automatically handled this, but until then I'd rather just leave it as-is.

jhb added a reviewer: jhb.
jhb added a subscriber: jhb.

Looks fine to me. I have a slight preference for doing COMPAT_FREEBSD11 in a separate commit from its first use.

sys/vm/vm_meter.c
318 ↗(On Diff #22768)

Mark is correct, the various compat options all require any "newer" compat options as well. Some of the #ifdef's would be very verbose otherwise. Right now we key the #ifdef off the first version it is removed (and put it under <n>). We'd have to instead figure out the range of used versions each time instead (and in this case this one would go all the way back for example).

One way we could perhaps make this explicit (but it would be a bit of work), would be to use a single COMPAT_FREEBSD option which is assigned a value of the oldest major version, so e.g.:

options  COMPAT_FREEBSD=9   # Support for binaries from 9.0 and later

This would still make the same assumption we make now, but instead of having to add a new COMPAT_FREEBSD<n> and updating kernel configs all the time, one just uses

#if COMPAT_FREEBSD <= 10
/* stub for something removed in 11 */
#endif

It also prevents users from generating an invalid kernel config.

This revision was automatically updated to reflect the committed changes.