Vyacheslav Dubeyko from IBM launched on the Linux kernel developer mailing list a discussion on the use of kernel of machine learning models, and suggested for testing a set of patches with library for integration ML models into the kernel and example of a symbolic driver that uses the library.
Integration of ML models into the kernel can be useful for changing the logic of subsystems, taking into account processed data, optimization of operation and configuration changes depending on the internal state of the systems. The use of machine learning, capable of identifying patterns and making predictions without manually implementing algorithms, will simplify the selection of the most effective kernel configuration, taking into account the complexity and variability of modern workloads, and will also allow solving problems such as predicting failures of storage systems.
In addition to the engine for executing models, the development of data collection tools for training ML models, directly training the model and testing the result is being considered. Since the execution of the ML model requires floating point operations, and the kernel does not allow direct use of the FPU, the proposed prototype represents a layer for accessing from various kernel subsystems to ML models executed in user space, similar to moving the SPDK, DPDK and ublk handlers into the user space.
Moving model execution and training into user space simplifies maintenance and isolates the kernel from problems in the model execution code. At the training stage, data about the state and parameters of the kernel can be either requested by a handler from user space or transmitted by a layer running at the kernel level. sysfs is used to manage the interaction between components in the kernel and user space. Adaptive training of the ML model is possible, in which the kernel subsystem receives a recommendation from the ML model, applies the recommended change, and evaluates the effectiveness of the state change recommendation.