In the
Linux kernel
The Linux kernel is a Free and open-source software, free and open source Unix-like kernel (operating system), kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the k ...
, kernfs is a set of
functions that contain the functionality required for creating the
pseudo file systems used internally by various
kernel
Kernel may refer to:
Computing
* Kernel (operating system), the central component of most operating systems
* Kernel (image processing), a matrix used for image convolution
* Compute kernel, in GPGPU programming
* Kernel method, in machine learnin ...
subsystems so that they may use
virtual files. For example, sysfs provides a set of virtual files by exporting information about hardware devices and associated
device driver
In the context of an operating system, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer or automaton. A driver provides a software interface to hardware devices, enabli ...
s from the kernel's device model to
user space
A modern computer operating system usually uses virtual memory to provide separate address spaces or regions of a single address space, called user space and kernel space. This separation primarily provides memory protection and hardware prote ...
.
The creation of kernfs resulted from splitting off part of the internal logic used by
sysfs. The associated
patchset, with Tejun Heo as its main author, was merged into the
Linux kernel mainline
The Linux kernel is a Free and open-source software, free and open source Unix-like kernel (operating system), kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the k ...
in kernel version 3.14, which was released on March 30, 2014.
Kernfs took the independent and reusable functionality of sysfs so other kernel subsystems can implement their own pseudo
file systems more easily and consistently.
One of the primary users of kernfs is the pseudo file system used internally by
cgroups
cgroups (abbreviated from control groups) is a Linux kernel feature that limits, accounts for, and isolates the resource usage (CPU, memory, disk I/O, etc.) of a collection of processes.
Engineers at Google started the work on this feature ...
, whose redesign continued into version 3.15 of the Linux kernel.
See also
*
procfs
The proc filesystem (procfs) is a special filesystem in Unix-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized metho ...
a pseudo file system in Unix-like operating systems that presents information about processes (and about some other system information)
*
tmpfs a pseudo file system for temporary file storage on many Unix-like operating systems
References
External links
Source code in the Linux kernel source tree
{{Operating system
Interfaces of the Linux kernel
Linux kernel features