countem2.sh: fix calc of # of kernel-mode stacks

in memory

Signed-off-by: Kaiwan N Billimoria <kaiwan.billimoria@gmail.com>
This commit is contained in:
Kaiwan N Billimoria
2024-12-27 16:10:57 +05:30
parent 40e778d808
commit 5963e897ac
2 changed files with 3 additions and 2 deletions

View File

@@ -81,6 +81,7 @@ with<br>
- page 264:
- Added the ch6/countem2.sh Bash script to the repo; it complements the ch6/countem.sh script, adding on a few details
- An error in the ch6/countem2.sh script has now (27dec2024) been fixed (fix calc of # of kernel-mode stacks in memory; feeing sheepish again!)
- Ch 13
- *Sincere apologies!* I've made several (small-ish) mistakes here! (please read on...)

View File

@@ -35,9 +35,9 @@ total_kthrds=$(cat ${TMPT}|awk '{print $10}'|grep "^\["|wc -l)
printf "3. Total # of kernel threads alive = %9d\n" ${total_kthrds}
printf " (each kthread will have a kernel-mode stack)\n"
total_uthrds=$((${total_thrds}-${total_kthrds}))
printf "4. Thus, total # of user mode threads = (2) - (3) = %9d\n" ${total_uthrds}
printf "4. Thus, total # of user mode threads = (2) - (3) = %9d\n" ${total_uthrds}
printf " (each uthread will have both a user and kernel-mode stack)\n"
printf "5. Thus, total # of kernel-mode stacks = (3) + (4)*2 = %9d\n" $((${total_kthrds}+(${total_uthrds}*2)))
printf "5. Thus, total # of kernel-mode stacks = (3) + (4) = %9d\n" $((${total_kthrds}+${total_uthrds}))
rm -f ${TMPP} ${TMPT}
exit 0