Hi all,

I want to know which thread is the kernel lock owner at one moment. It's just 
for fun and  to learn a bit more.

By the moment, using dtrace I can get the information when a process execute a 
mutex_enter syscall. 

  0   1549     mutex_enter:adaptive-acquire          fsflush 60003e50740 0
  0   1549     mutex_enter:adaptive-acquire          fsflush 600003be578 0
  0   1549     mutex_enter:adaptive-acquire          fsflush 60003e50740 0
  0   1549     mutex_enter:adaptive-acquire          fsflush 3000e60a100 0
  0   1549     mutex_enter:adaptive-acquire          fsflush 600003be578 0

The last column is the first argument of the mutex_enter syscall.

void mutex_enter(kmutex_t *mp);

Thats the address of a pointer to a structure kmutex_t.

typedef struct mutex {
#ifdef _LP64
     void *_opaque[1];
#else
    void *_opaque[2];
#endif } kmutex_t; 

BTW I have read at the Solaris Internal book that the thread address of a lock 
owner is contained in the m_owner field of a structure m_adaptive.

The problem is that I don't known how the kmutex_t and m_adaptive structures 
are related. This opaque pointer is confusing me.

Any help is welcome, TIA.

Roger
 
 
--
This messages posted from opensolaris.org

Reply via email to