How to Show Kernel Threads in htop?
The htop interactive process viewer for Linux hides
kernel threads by default to keep the process list clean and readable.
However, when debugging system performance or analyzing driver behavior,
displaying these threads becomes necessary. This article provides a
quick, step-by-step guide on how to toggle the visibility of kernel
threads using both keyboard shortcuts and the graphical setup menu
within htop.
Method 1: The Quick Keyboard Shortcut
The fastest way to toggle kernel threads on and off is by using a
direct keyboard shortcut while htop is actively
running.
- Press
Shift + K(capitalK) on your keyboard.
Pressing this key combination will instantly insert the kernel
threads into your process list (usually distinguished by a different
color, such as green, depending on your color scheme). Pressing
Shift + K a second time will hide them again.
Method 2: Using the Setup Menu
If you prefer navigating the menus or want to verify the setting visually, you can toggle kernel threads through the configuration screen.
- Launch
htopin your terminal. - Press
F2(orS) to enter the Setup menu. - Use the arrow keys to navigate down to the Display options column.
- Press the right arrow key to move into the options list.
- Scroll down to the option labeled “Hide kernel threads”.
- Press the Spacebar to uncheck the box (which will show the threads).
- Press
F10(orEsc) to save your changes and return to the main window.
How to Tell the Difference
Once enabled, kernel threads can be easily identified in the process
list. They typically appear wrapped in axis brackets or Ames-style
brackets, such as [kthreadd] or
[kworker/0:1H], and they do not consume standard user
memory space.