kthread
also: kernel thread
A kernel thread is a lightweight execution context that runs entirely in kernel space, used by the kernel to perform background tasks without requiring a user-space process.
Kernel threads (kthreads) are threads created and managed by the Linux kernel itself, rather than by user applications. They run exclusively in kernel space with access to kernel memory and functions, making them ideal for handling asynchronous kernel operations.
Common uses include managing I/O operations, garbage collection, scheduling, and device drivers. You can see active kernel threads in the output of ps aux or top—they typically appear in square brackets, such as [kworker/0:1], [kswapd0], or [migration/0].
Unlike user threads, kthreads have no associated memory address space or file descriptors of their own. They are created using the kthread_create() kernel API and are primarily used by kernel subsystems and device drivers to parallelize work without burdening the scheduler with additional user-space processes.