Skip to content

Commit

Permalink
kernel: clean-up build-configurable kernel config symbols
Browse files Browse the repository at this point in the history
Don't explicitely disable options in target/linux/generic/config-* if
they are already controlled in config/Config-kernel.in.
Add a bunch of new symbols  and prepare defaults for using only unified
hierarchy (ie. cgroup2). Update symbol dependencies while at it

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  • Loading branch information
dangowrt committed Jul 30, 2020
1 parent 917980f commit d1a8217
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 37 deletions.
49 changes: 39 additions & 10 deletions config/Config-kernel.in
Expand Up @@ -357,6 +357,18 @@ config KERNEL_BLK_DEV_BSG
bool "Compile the kernel with SCSI generic v4 support for any block device"
default n

config KERNEL_TRANSPARENT_HUGEPAGE
bool

config KERNEL_HUGETLBFS
bool

config KERNEL_HUGETLB_PAGE
bool "Compile the kernel with HugeTLB support"
select KERNEL_TRANSPARENT_HUGEPAGE
select KERNEL_HUGETLBFS
default n

config KERNEL_MAGIC_SYSRQ
bool "Compile the kernel with SysRq support"
default y
Expand Down Expand Up @@ -551,21 +563,29 @@ if KERNEL_CGROUPS

config KERNEL_FREEZER
bool
default y if KERNEL_CGROUP_FREEZER

config KERNEL_CGROUP_FREEZER
bool "Freezer cgroup subsystem"
default y
bool "legacy Freezer cgroup subsystem"
default n
select KERNEL_FREEZER
help
Provides a way to freeze and unfreeze all tasks in a
cgroup.
(legacy cgroup1-only controller, in cgroup2 freezer
is integrated in the Memory controller)

config KERNEL_CGROUP_DEVICE
bool "Device controller for cgroups"
default y
bool "legacy Device controller for cgroups"
default n
help
Provides a cgroup implementing whitelists for devices which
a process in the cgroup can mknod or open.
(legacy cgroup1-only controller)

config KERNEL_CGROUP_HUGETLB
bool "HugeTLB controller"
default y if KERNEL_HUGETLB_PAGE
depends on KERNEL_HUGETLB_PAGE

config KERNEL_CGROUP_PIDS
bool "PIDs cgroup subsystem"
Expand All @@ -574,6 +594,14 @@ if KERNEL_CGROUPS
Provides enforcement of process number limits in the scope of a
cgroup.

config KERNEL_CGROUP_RDMA
bool "RDMA controller for cgroups"
default y

config KERNEL_CGROUP_BPF
bool "Support for eBPF programs attached to cgroups"
default y

config KERNEL_CPUSETS
bool "Cpuset support"
default y if !SMALL_FLASH
Expand Down Expand Up @@ -609,6 +637,7 @@ if KERNEL_CGROUPS
config KERNEL_MEMCG
bool "Memory Resource Controller for Control Groups"
default y if !SMALL_FLASH
select KERNEL_FREEZER
depends on KERNEL_RESOURCE_COUNTERS || !LINUX_3_18
help
Provides a memory resource controller that manages both anonymous
Expand All @@ -631,7 +660,7 @@ if KERNEL_CGROUPS

config KERNEL_MEMCG_SWAP
bool "Memory Resource Controller Swap Extension"
default n
default y if !SMALL_FLASH
depends on KERNEL_MEMCG
help
Add swap management feature to memory resource controller. When you
Expand Down Expand Up @@ -763,12 +792,12 @@ if KERNEL_CGROUPS
files in a cgroup which can be useful for debugging.

config KERNEL_NET_CLS_CGROUP
bool "Control Group Classifier"
default y
bool "legacy Control Group Classifier"
default n

config KERNEL_CGROUP_NET_PRIO
bool "Network priority cgroup"
default y
bool "legacy Network priority cgroup"
default n

endif

Expand Down
9 changes: 0 additions & 9 deletions target/linux/generic/config-4.14
Expand Up @@ -725,13 +725,6 @@ CONFIG_CC_STACKPROTECTOR_NONE=y
# CONFIG_CFG80211 is not set
# CONFIG_CFG80211_CERTIFICATION_ONUS is not set
# CONFIG_CFQ_GROUP_IOSCHED is not set
# CONFIG_CGROUPS is not set
# CONFIG_CGROUP_BPF is not set
# CONFIG_CGROUP_DEBUG is not set
# CONFIG_CGROUP_HUGETLB is not set
# CONFIG_CGROUP_NET_CLASSID is not set
# CONFIG_CGROUP_NET_PRIO is not set
# CONFIG_CGROUP_RDMA is not set
# CONFIG_CHARGER_BQ2415X is not set
# CONFIG_CHARGER_BQ24190 is not set
# CONFIG_CHARGER_BQ24257 is not set
Expand Down Expand Up @@ -1756,7 +1749,6 @@ CONFIG_HPET_MMAP_DEFAULT=y
# CONFIG_HTC_PASIC3 is not set
# CONFIG_HTS221 is not set
# CONFIG_HTU21 is not set
# CONFIG_HUGETLB_PAGE is not set
# CONFIG_HVC_DCC is not set
# CONFIG_HVC_UDBG is not set
# CONFIG_HWLAT_TRACER is not set
Expand Down Expand Up @@ -5132,7 +5124,6 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
# CONFIG_TRACING_EVENTS_GPIO is not set
CONFIG_TRACING_SUPPORT=y
CONFIG_TRAD_SIGNALS=y
# CONFIG_TRANSPARENT_HUGEPAGE is not set
# CONFIG_TREE_RCU is not set
# CONFIG_TREE_RCU_TRACE is not set
# CONFIG_TRIM_UNUSED_KSYMS is not set
Expand Down
8 changes: 0 additions & 8 deletions target/linux/generic/config-4.19
Expand Up @@ -743,12 +743,6 @@ CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
# CONFIG_CEPH_LIB is not set
# CONFIG_CFG80211 is not set
# CONFIG_CFG80211_CERTIFICATION_ONUS is not set
# CONFIG_CGROUPS is not set
# CONFIG_CGROUP_BPF is not set
# CONFIG_CGROUP_DEBUG is not set
# CONFIG_CGROUP_NET_CLASSID is not set
# CONFIG_CGROUP_NET_PRIO is not set
# CONFIG_CGROUP_RDMA is not set
# CONFIG_CHARGER_ADP5061 is not set
# CONFIG_CHARGER_BQ2415X is not set
# CONFIG_CHARGER_BQ24190 is not set
Expand Down Expand Up @@ -1867,7 +1861,6 @@ CONFIG_HPET_MMAP_DEFAULT=y
# CONFIG_HTC_PASIC3 is not set
# CONFIG_HTS221 is not set
# CONFIG_HTU21 is not set
# CONFIG_HUGETLB_PAGE is not set
# CONFIG_HVC_DCC is not set
# CONFIG_HVC_UDBG is not set
# CONFIG_HWLAT_TRACER is not set
Expand Down Expand Up @@ -5403,7 +5396,6 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
# CONFIG_TRACING_EVENTS_GPIO is not set
CONFIG_TRACING_SUPPORT=y
CONFIG_TRAD_SIGNALS=y
# CONFIG_TRANSPARENT_HUGEPAGE is not set
# CONFIG_TREE_RCU is not set
# CONFIG_TREE_RCU_TRACE is not set
# CONFIG_TRIM_UNUSED_KSYMS is not set
Expand Down
10 changes: 0 additions & 10 deletions target/linux/generic/config-5.4
Expand Up @@ -791,13 +791,6 @@ CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
# CONFIG_CEPH_LIB is not set
# CONFIG_CFG80211 is not set
# CONFIG_CFG80211_CERTIFICATION_ONUS is not set
# CONFIG_CGROUPS is not set
# CONFIG_CGROUP_BPF is not set
# CONFIG_CGROUP_DEBUG is not set
# CONFIG_CGROUP_HUGETLB is not set
# CONFIG_CGROUP_NET_CLASSID is not set
# CONFIG_CGROUP_NET_PRIO is not set
# CONFIG_CGROUP_RDMA is not set
# CONFIG_CHARGER_ADP5061 is not set
# CONFIG_CHARGER_BQ2415X is not set
# CONFIG_CHARGER_BQ24190 is not set
Expand Down Expand Up @@ -2005,8 +1998,6 @@ CONFIG_HPET_MMAP_DEFAULT=y
# CONFIG_HTC_PASIC3 is not set
# CONFIG_HTS221 is not set
# CONFIG_HTU21 is not set
# CONFIG_HUGETLBFS is not set
# CONFIG_HUGETLB_PAGE is not set
# CONFIG_HVC_DCC is not set
# CONFIG_HVC_UDBG is not set
# CONFIG_HWLAT_TRACER is not set
Expand Down Expand Up @@ -5763,7 +5754,6 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
# CONFIG_TRACING_EVENTS_GPIO is not set
CONFIG_TRACING_SUPPORT=y
CONFIG_TRAD_SIGNALS=y
# CONFIG_TRANSPARENT_HUGEPAGE is not set
# CONFIG_TREE_RCU is not set
# CONFIG_TREE_RCU_TRACE is not set
# CONFIG_TRIM_UNUSED_KSYMS is not set
Expand Down

9 comments on commit d1a8217

@hnyman
Copy link
Contributor

@hnyman hnyman commented on d1a8217 Jul 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dangowrt

I see now this in my build for ipq806x/R7800 and the build breaks:

Qualcomm IPC Router support (QRTR) [N/m/y/?] n
NCSI interface support (NET_NCSI) [N/y/?] n
Network priority cgroup (CGROUP_NET_PRIO) [N/y/?] n
Network classid cgroup (CGROUP_NET_CLASSID) [N/y/?] (NEW) 

Apparently the line # CONFIG_CGROUP_NET_CLASSID is not set was deleted, but no default for that was provided with a new option.

@hnyman
Copy link
Contributor

@hnyman hnyman commented on d1a8217 Jul 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error from buildbot:

http://buildbot.openwrt.org/master/images/builders/at91%2Fsam9x/builds/531/steps/kmods/logs/stdio

NCSI interface support (NET_NCSI) [N/y/?] n
Network priority cgroup (CGROUP_NET_PRIO) [N/y/?] n
Network classid cgroup (CGROUP_NET_CLASSID) [N/y/?] (NEW) aborted!

Console input/output is redirected. Run 'make oldconfig' to update configuration.

scripts/kconfig/Makefile:38: recipe for target 'silentoldconfig' failed
make[6]: *** [silentoldconfig] Error 1
Makefile:527: recipe for target 'silentoldconfig' failed
make[5]: *** [silentoldconfig] Error 2

The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernel with module support enabled.

Makefile:1314: recipe for target 'modules' failed
make[4]: *** [modules] Error 1
make[4]: Leaving directory '/builder/shared-workdir/build/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_sam9x/linux-4.14.187'

@adschm
Copy link
Member

@adschm adschm commented on d1a8217 Jul 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the buildbots only fail for 4.14 targets, and even not all of them (ramips/rt**** and ath25 still build fine).

@adschm
Copy link
Member

@adschm adschm commented on d1a8217 Jul 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I just were affected for local build on kirkwood (5.4). I remotely remember a discussion that buildbots might just suppress those prompts implicitly ...

@adschm
Copy link
Member

@adschm adschm commented on d1a8217 Jul 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, the reason why most buildbots don't fail is actually discussed here:
#2948

@adschm
Copy link
Member

@adschm adschm commented on d1a8217 Aug 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dangowrt Just did a config refresh on ipq40xx (make kernel_oldconfig), and got prompted about CONFIG_CGROUPS:

* Control Group support
*
Control Group support (CGROUPS) [N/y/?] (NEW)

@adschm
Copy link
Member

@adschm adschm commented on d1a8217 Aug 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping. Am I the only one with that missing CGROUPS symbol?

@peterwillcn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sat Aug  8 19:09:02 2020 daemon.err dockerd[2561]: time="2020-08-08T11:09:02.033225252Z" level=warning msg="Your kernel does not support cgroup blkio weight"
Sat Aug  8 19:09:02 2020 daemon.err dockerd[2561]: time="2020-08-08T11:09:02.033533292Z" level=warning msg="Your kernel does not support cgroup blkio weight_device"
Sat Aug  8 19:09:03 2020 daemon.err dockerd[2561]: failed to start daemon: Devices cgroup isn't mounted

@dangowrt
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to enable build-time options for legacy-cgroup1-only controllers (such as devices, net_prio, net_cls) in menuconfig, they are no longer included by default.
It'd be sad to encourage the use of legacy functions which prevent using the modern interfaces (which is true for cgroup1 controllers). Hence, as 19.07 came without cgroup1 per default, we will keep it like that for 20.x (and supposedly everything after). cgroup2 is enabled and supports device-firewalling using eBPF, it has been decided that the previous 'devices' cgroup will not be implemented in cgroup2 (hence Docker needs to change and make use of cgroup2 in order to work on mordern systems).

Please sign in to comment.