Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel: improve config handling of IO_URING and DYNAMIC_DEBUG #12482

Merged

Conversation

guidosarducci
Copy link
Contributor

This includes changes in handling two kernel config settings with notable impact to kernel sizes:

  1. Kernel setting CONFIG_IO_URING supports high-performance I/O for file access and servers, generally for more performant platforms, and adds ~45 KB to kernel sizes. The need for this on less "beefy" devices is questionable, as is the size cost considering many platforms have kernel size limits which require tricky repartitioning if outgrown. The size cost is also large relative to the ~180 KB bump expected between major OpenWRT kernel releases.

    No OpenWrt packages have hard dependencies on this; samba4 and mariadb can take advantage if available (+KERNEL_IO_URING:liburing) but otherwise build and work fine.

    Since CONFIG_IO_URING is already managed via the KERNEL_IO_URING setting in Config-kernel.in (default Y), remove it from those target configs which unconditionally enable it, and update the defaults to enable it conditionally only on more powerful 64-bit x86 and arm devices. It may still be manually enabled as needed for high-performance custom builds.

  2. Since CONFIG_DYNAMIC_DEBUG is already managed via the KERNEL_DYNAMIC_DEBUG setting in Config-kernel.in (default N), remove or disable it in target configs which unconditionally enable it, along with the related setting CONFIG_DYNAMIC_DEBUG_CORE. This saves several KB in the kernels for ipq40xx, ipq806x, filogic, mt7622, qoriq, and sunxi.

These changes were investigated and mentioned during development of #11405 , and requested as a follow-up PR. They have been build- and run-tested on malta/be32, including the mariadb and samba4 packages. These commits together reduced LZMA kernel size by ~50 KB.

(Note: while working on #11405 , these changes alone would have avoided the need to repartition the ipq40xx device, and there are a number of related changes e.g. see the WIP at https://github.com/guidosarducci/openwrt/commits/master-clean-configs)

Please have a look and comment @hauke and @Ansuel .

@github-actions github-actions bot added kernel pull request/issue with Linux kernel related changes target/airoha pull request/issue for airoha target target/bcm53xx pull request/issue for bcm53xx target target/gemini pull request/issue for gemini target target/imx pull request/issue for imx (imx6) target target/ipq40xx pull request/issue for ipq40xx target target/ipq806x pull request/issue for ipq806x target target/mediatek pull request/issue for mediatek target target/qoriq pull request/issue for qoriq target target/rockchip pull request/issue for rockchip target target/sunxi pull request/issue for sunxi target target/x86 pull request/issue for x86 target labels Apr 26, 2023
@Ansuel
Copy link
Member

Ansuel commented Apr 26, 2023

@guidosarducci i like this change. Maybe for rockchip we can also enable by default, should not be a small flash target and afaik many board are used for file sharing in mind

@guidosarducci
Copy link
Contributor Author

@guidosarducci i like this change. Maybe for rockchip we can also enable by default, should not be a small flash target and afaik many board are used for file sharing in mind

@Ansuel Hi Christian, since rockchip has ARCH:=aarch64 it will be enabled by default. Are you OK with this otherwise?

The rationale for default y if (x86_64 || aarch64) is that these are likely "desktop-class" systems, lacking kernel-size limitations, and with OK memory, CPU, and HW I/O specs... i.e. not really the HPC platforms pumping 2GB/s I/O where IO_URING shines, but likely still the best performing OWRT devices.

@Ansuel
Copy link
Member

Ansuel commented Apr 26, 2023

@guidosarducci oh ok! Yep I already got your logic before by looking at the change and it totally correct!

LGTM. If no one have anything against this in a few days i will merge this!

@guidosarducci
Copy link
Contributor Author

Thanks! For reference, these would be the targets enabled by default:

$ git grep -E "ARCH:=aarch64|ARCH:=x86_64" target/linux
target/linux/armvirt/64/target.mk:ARCH:=aarch64
target/linux/bcm27xx/bcm2710/target.mk:ARCH:=aarch64
target/linux/bcm27xx/bcm2711/target.mk:ARCH:=aarch64
target/linux/bcm4908/Makefile:ARCH:=aarch64
target/linux/ipq807x/Makefile:ARCH:=aarch64
target/linux/layerscape/armv8_64b/target.mk:ARCH:=aarch64
target/linux/mediatek/filogic/target.mk:ARCH:=aarch64
target/linux/mediatek/mt7622/target.mk:ARCH:=aarch64
target/linux/mvebu/cortexa53/target.mk:ARCH:=aarch64
target/linux/mvebu/cortexa72/target.mk:ARCH:=aarch64
target/linux/octeontx/Makefile:ARCH:=aarch64
target/linux/rockchip/armv8/target.mk:ARCH:=aarch64
target/linux/sunxi/cortexa53/target.mk:ARCH:=aarch64
target/linux/uml/Makefile:ARCH:=x86_64
target/linux/x86/64/target.mk:ARCH:=x86_64

@Ansuel
Copy link
Member

Ansuel commented Apr 28, 2023

I'm not really sure for the bcm targets... no idea they were aarch64 honestly... Anyway I would wait what @hauke think about this and then i will merge... We have also the other cleanup to merge so lots of fun stuff to change

@guidosarducci
Copy link
Contributor Author

Sure, it was @hauke who requested the PR when I suggested this change, so would like to hear from him too. BTW, those BCM targets cover things like Raspberry Pi and Netgear R8000p, which seem appropriate.

We have also the other cleanup to merge so lots of fun stuff to change

Oooh, what cleanup is that? Good cleanups don't get the attention they deserve in my experience...

@guidosarducci
Copy link
Contributor Author

Ping @Ansuel . Any success with feedback from @hauke ? I haven't run into him on IRC myself. And the cleanup you mentioned?

@Ansuel
Copy link
Member

Ansuel commented May 3, 2023

@guidosarducci i'm ok with merging this, but i can rebase for you. Can you rebase on top of master?

Since CONFIG_DYNAMIC_DEBUG is already managed via the KERNEL_DYNAMIC_DEBUG
setting in Config-kernel.in (default N), remove or disable it in target
configs which unconditionally enable it, along with the related setting
CONFIG_DYNAMIC_DEBUG_CORE. This saves several KB in the kernels for
ipq40xx, ipq806x, filogic, mt7622, qoriq, and sunxi.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Kernel setting CONFIG_IO_URING supports high-performance I/O for file
access and servers, generally for more performant platforms, and adds
~45 KB to kernel sizes. The need for this on less "beefy" devices is
questionable, as is the size cost considering many platforms have kernel
size limits which require tricky repartitioning if outgrown. The size
cost is also large relative to the ~180 KB bump expected between major
OpenWRT kernel releases.

No OpenWrt packages have hard dependencies on this; samba4 and mariadb
can take advantage if available (+KERNEL_IO_URING:liburing) but
otherwise build and work fine.

Since CONFIG_IO_URING is already managed via the KERNEL_IO_URING setting
in Config-kernel.in (default Y), remove it from those target configs
which unconditionally enable it, and update the defaults to enable it
conditionally only on more powerful 64-bit x86 and arm devices. It may
still be manually enabled as needed for high-performance custom builds.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
@guidosarducci
Copy link
Contributor Author

@Ansuel Thanks! I've rebased on master... Repeating the checks will take some time however.

@openwrt-bot openwrt-bot merged commit 3d66f55 into openwrt:master May 4, 2023
139 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel pull request/issue with Linux kernel related changes target/airoha pull request/issue for airoha target target/bcm53xx pull request/issue for bcm53xx target target/gemini pull request/issue for gemini target target/imx pull request/issue for imx (imx6) target target/ipq40xx pull request/issue for ipq40xx target target/ipq806x pull request/issue for ipq806x target target/mediatek pull request/issue for mediatek target target/qoriq pull request/issue for qoriq target target/rockchip pull request/issue for rockchip target target/sunxi pull request/issue for sunxi target target/x86 pull request/issue for x86 target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants