The kernel semaphore is a RAMSEM and EVENT SEM with accountability in-built.
Many system control block have imbedded KSEMs. Included among these are the PTDA and MFT.
Some KSEMs are allocated out of the kernel heaps and have the owner mnemonic KSEM.
When a thread blocks on a KSEM the address (or handle) of the KSEM, or a field within the KSEM, is used as the BlockId depending upon the KSEM type.
For MUTEX KSEMs
Under the debug (ALLSTRICT) kernel the KSEM contains an additional signature 'KSEM'. Always check a BlockId address to see if the 'KSEM' signature is present.
.D KSEM will format the KSEM.
In this example we look at Slot 6c to find out why it will not run.
#.pb 6c Slot Sta BlockID Name Type Addr Symbol 006c blk 7bdfc910 DEMO1 # .m 7bdfc910 *har par cpg va flg next prev link hash hob hal 0087 %fef1fba4 00000082 %7bdf5000 121 0085 0088 0000 0000 0089 0000 =0000 hob har hobnxt flgs own hmte sown,cnt lt st xf 0089 0087 0000 0325 ffcb 0000 0000 00 00 00 00 ptda >> This thread is blocked on an address in (its) PTDA. All PTDA >> semaphores are KSEMs. # .d KSEM %7bdfc910 Signature : KSEM Nest: 0001 Type : MUTEX Flags : 00 Owner : 0041 PendingWriters: 0001 >> So the owner is Slot 41. Lets look at him to see what he's up to. # .pb 41 Slot Sta BlockID Name Type Addr Symbol 0041 blk 04085ca7 DEMO1 # .m #408:5ca7 *har par cpg va flg next prev link hash hob hal 0079 %fef1fa70 00000010 %7bf27000 129 0078 0077 0000 0000 007b 0000 sel=0408 hob har hobnxt flgs own hmte sown,cnt lt st xf 007b 0079 0000 0324 ffa1 0000 0000 00 00 00 00 sft # >> Slot 41 is blocked waiting for some file system activity to complete. >> We looked at this slot some time ago and found out that it was >> waiting to close a device driver.