Here are a few things I can recall, from [[UnderstandingLinuxKernel]].
P 104 lists some minor Linux kernel threads, but here are the important ones:
- process 0 (swapper) is a kernel thread. This process gets scheduled when there’s no other process to run
- process 1 (init) is a kernel thread. This process launches and monitors all other processes except process 0. It’s also the adopted parents of all orphaned zombies
- both of them run forever. Most other linux kernel threads run for a short while and exit.
Linux kernThr is completely unrelated concept to traditional unix kernThr. More difference than similarities (zero?)
- Unix kernel threads aka “native threads” concept was first known to me in jvm. kernel scheduler can see native threads but not java green threads.
- native threads often run user mode but linux kernel threads only run in kernel mode and very limited in usage. I think they are mostly set up to access hardware
Linux kernel threads are less fundamental than kernel routines including sysCall handlers + interrupt handlers.
- every Linux user process enter kernel mode via kernel routines
- not every user process interacts with kernel threads