3

When using the top command on a linux server, I can see multiple root processes starting with the letter k, like for example kthreadd, kblockd, khelper, kacpi_notify, ksmd, kswapd0, khugepaged, ksmd and much more.

I assume it's not a coincidence; what does the k stand for here?

3
  • 1
    A bit googling tells you "kernel"
    – deviantfan
    Jun 10 '16 at 15:34
  • @deviantfan I guessed "k" for "kernel" without googling :)
    – DavidPostill
    Jun 10 '16 at 15:35
  • 1
    @DavidPostill That was meant as a hint to OP that writing questions for this is not necessary, not that we all need Google for this.
    – deviantfan
    Jun 10 '16 at 15:37
7

Those aren’t processes but kernel threads:

Threads are "light weight processes" (LWPs). [...]

[...]

Kernel-space threads often are implemented in the kernel using several tables (each task gets a table of threads). In this case, the kernel schedules each thread within the timeslice of each process. There is a little more overhead with mode switching from user->kernel-> user and loading of larger contexts, but initial performance measures indicate a negligible increase in time.

Advantages. Since the clocktick will determine the switching times, a task is less likely to hog the timeslice from the other threads within the task. Also I/O blocking is not a problem. Lastly, if properly coded, the process automatically can take advantage of SMPs and will run incrementally faster with each added CPU.

Related reading

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.