Continuing our discussion with reference to the countem.sh Bash script that we ran in the previous section, we will now break it down and discuss some key points, confining ourselves to the kernel space portion of the VAS. Please take care to carefully read and understand this (while reading the numbers that were output in our preceding sample run of the countem.sh script). For the sake of better understanding I have placed the kernel space portion of the diagram here (Figure 6.5):
Again, from our preceding sample run, you can see that there are 1,053 user-mode threads and 181 kernel threads currently alive on the system. This yields a total of 1,234 kernel space stacks. How? As mentioned earlier, every user-mode thread has two stacks – one user-mode stack and one kernel-mode stack. Thus, we'll have 1,053 kernel-mode stacks for each...