Nvidia Linux Kernel minimization (defconfig minimization)

Good afternoon, dear Nvidia! I have the task to optimize kernel as much as I can. I only need system and GPU to work and all. I don’t need so much options that you kernel has.
I tried to minimize it but there is one problem - I cannot disable tracing and debug options that we don’t need and which inflate the kernel.
I tried to remove it in defconfig but it every time appears in .config. Because of flag CONFIG_DEBUG_FS building fails. I don’t need this flag but I cannot remove this.
I wrote script that removes options that I don’t need after .config generating (it is altering .config, auto.conf and config.h but now I have a lot of dependency problems.
So my answer is how can I critically minimize defconfig and kernel respectively and remove all debug and tracing options? Maybe someone can help me?

Do I really need all of this options? There is a lot of tegra options in defconfig but it seems like we don’t really need all of this. I have to optimize rootfs and kernel to such small size to provide RAMboot.


I cannot answer, but you might find this useful…

The silicon on each successive generation of Tegra SoC tends to keep some silicon from prior releases. For example, consider a serial UART; this likely does not change from one generation to the next, and so if the next generation uses more such UARTs, then instead of replacing the existing silicon, there would instead be more copies of that silicon. That means that there is a lot of inheritance of newer generations from older generations. Part of the features on a Tegra 18x might be obsolete…it is possible…but the presence of all of them is overall probably still required. You could try removing one with the correct configuration editor (such as the menuconfig or nconfig editor; I prefer nconfig, both understand feature dependencies, but nconfig adds a symbol search).

Also, consider that the same features can sometimes (depending on several details) leave a larger size due to debug symbols. If a module or the kernel itself is not stripped, then you might try the strip tool. If you are cross compiling, then it might be something like this:
<tool_chain_path>/aarch64-linux-gnu-strip -–strip-unneeded <path-of-kernel-module.ko>

The above will not reduce actual features of the kernel, but it will reduce the size by a lot (and any dumped stack frames will then show addresses without knowledge of what code is behind the stack frame).

If you are natively on the Jetson, then you can use the “strip” program (it is part of binutils, so likely nobody needs to add this).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.