In this doc, I will try to give you a brief of the Linux kernel changes between 4.x and 5.4 (5.0/5.1/5.2/5.3/5.4), which related to i.MX users/developers:
I cannot make sure every single change's description is 100% correct. Either, I cannot list all of the impacts to the i.MX platform due to my limited knowledge and experiences. I hope this doc can help you on developing kernel drivers, user applications or debugging issues of 5.x i.MX kernel release.
Subsystem/Modules | Detail changes | Comments | References |
---|---|---|---|
Kernel Cores | binder: new binderfs, a pseudo-filesystem for the Android Binder IPC driver which can be mounted per-ipc namespace allowing to run multiple instances of Android | Hmm... that may imply we can run multi-instance Android without Hypervisor? | |
sysctl: add panic_print sysctl to configure which information to print at panic time, w/ replay option | So we can define the panic information for better debugging the crash issue. Also option for users to configure the "panic_print" to replay all dmesg in buffer, some of which they may have never seen due to the loglevel setting, which will help panic debugging | How to use | |
boot: Add boot option ( driver_async_probe=... ) to specify drivers to be async probed | Asynchronous driver probing can help much on kernel fastboot, and this option can provide a flexible way to optimize and quickly verify async driver probe. | ||
swiotlb: add debugfs to track swiotlb buffer usage | The device driver will not be able to do dma operations once swiotlb buffer is full, either because the driver is using so many IO TLB blocks inflight, or because there is memory leak issue in device driver. Export buffer usage in debugfs can help. Please note, almost all of the dma buffers on i.MX8 platform comes from swiotlb. | ||
New mount syscall API | The kernel supports a wide variety of filesystem types, and each has its own, often extensive set of options. As a result, the mount() system call is complex. This makes application code who need mount FS more clear. | Six (or seven) new system calls for filesystem mounting [LWN.net] | |
New APIs to support pidfs | clone return pidfs, new syscall pidfd_send_signal(2), which uses file descriptors from /proc/<pid> as stable handles on struct pid. | ||
locking: rwsem improvement | unification and simpler micro-optimizations, performance improvement of this locking primitive. | ||
Preparations for PREEMPT_RT | It's excited that community decided to merge the PREEMPT_RT kernel changes into mainline. It's well known as rt-patch for hard real-time use cases like industry. | Index of /pub/linux/kernel/projects/rt/ | |
Memory management | KASAN: Improved the KASAN performance for arm64 | KernelAddressSANitizer (KASAN) is a dynamic memory error detector. It provides a fast and comprehensive solution for finding use-after-free and out-of-bounds bugs. It's useful when debugging kernel drivers and modules memory issue. | The Kernel Address Sanitizer (KASAN) — The Linux Kernel documentation |
Fragmentation avoidance improvements, reducing fragmentation events by over 90%. With this change, the page allocator would spread allocations across zones before introducing fragmentation. | We can always found customer's product memory fragment in some use cases in old kernel. Which would cause kmalloc or cma alloc failure and system stop. Balance between zones (i.MX8 we have DMA/NORMAL zones) to avoid fragment is very helpful. | One of customer case(fixed by not using kmalloc): https://jira.sw.nxp.com/browse/MLK-23220 | |
Increase success rates and reduce latency of compaction (physical memory defragmentation) | Memory compaction is the way to avoid memory fragment. | ||
Improve Out Of Memory (OOM) reports, include victim's memcg | More clear kernel OOM report may help lot | ||
Remove the ancient OOM killer heuristic that preferred to kill children of the "worst" process rather than the process itself | Improve the OOM efficiency | ||
zram improvements, which can help estimate wasted memory, and perform writeback that will free it | zram is actually used very widely in the Android system as backup swap for physical memory. Swap performance is very important. | ||
Simplify some of the early memory allocations by replacing usage of older memblock APIs with newer and shinier ones | memblock API changes. If you used memblock in your drivers, then need to check. | Boot time memory management — The Linux Kernel documentation | |
psi: Improves the Pressure Stall Information resource monitoring | With this mechanism, Android can monitor for, and ward off, mounting memory shortages before they cause problems for the user. For example, using memory stall, monitors in userspace like the low memory killer daemon (lmkd) can detect mounting pressure and kill less important processes. Supported in Android10, replace the vmpressure. | Low Memory Killer Daemon (lmkd) | Android Open Source Project | |
Improve vmap allocation | Speed up the vmalloc | ||
Introduce madvise() flags MADV_COLD, MADV_FREE, MADV_PAGEOUT | MADV_COLD marks pages as inactive (thus more easily reclaimed under memory pressure), but doesn't discard the contents like MADV_FREE does, and MADV_PAGEOUT , which reclaims pages immediately. Android would use this flags for better memory management | ||
memcg: from v1->v2 |
| ||
Block layer | Boot to a device-mapper device without initramfs | DM is widely used, you can not bootup to DM rootfs directly. Android 10 would use dynamic partition by creating super partition for /system, /vendor of dm-linear | Implementing Dynamic Partitions | Android Open Source Project |
Tracing and Perf | Perf: lots of improvement | TBD | |
Security | security: Create "kernel hardening" config area | Help mitigate kernel vulnerabilities and find bugs in kernel drivers, like Stack buffer overflow mitigation, Hardened usercopy | Kernel Hardening | Android Open Source Project |
LSM: Add kernel lockdown functionality | When enabled, the new "lockdown" feature will restrict some kernel functionality, even for the root user, making it harder for compromised root accounts to compromise the rest of the OS | Kernel lockdown in 4.17? [LWN.net] | |
Networking | Enable MSG_ZEROCOPY for udp sockets | Improve the UDP sending performance. Pay attention that the zero copy UDP sockets only limit to the send operations, not receive. Also require application code change, not efficient at small MTU. | Zero-copy networking [LWN.net] |
ARM/ARM64 | New SoCs:
| ||
perf vendor events: Add Cortex-A57 and Cortex-A72 events | support all ARMv8 recommended events | ||
Make CONFIG_ZONE_DMA32 configurable commit | Which means you can remove the DMA zone, and use only one single normal zone in kernel. | ||
Drivers | drm: Initial merge of timeline sync objects | Timeline syncobj gives user more flexibility and convenience to do sychronization. Android does not used. | |
Staging driver: i.MX7 MIPI CSI subdev | |||
NXP QuadSPI driver | |||
Introduce Sound Open Firmware (SOF) for audio DSP devices | Big changes to the current HiFi4 DSP (in i.MX8QM/QXP) infrastructure. The SOF is an open source audio DSP firmware and SDK that provides audio firmware infrastructure and development tools. Also integrated with current kernel alsa subsystem. | ||
Add NXP SJA1105 DSA network driver with ptp support | Used for networking switch | ||
Add TJA11xx PHY driver | |||
Add lpspi driver support | |||
fsl_lpuart: add imx8qxp support | |||
Add SCU watchdog/RTC support | |||
regmap: add i3c bus support commit | Means we can have i3c bus support in regmap now. |