Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lock improvements #111

Merged
merged 2 commits into from
Oct 30, 2024
Merged

Lock improvements #111

merged 2 commits into from
Oct 30, 2024

Conversation

brenns10
Copy link
Member

@brenns10 brenns10 commented Oct 1, 2024

One fix for mutexes, and then an enhancement to the printing for the locks, so that they print the symbol name or slab cache they came from. EG:

Scanning Mutexes...

Mutex: 0xffffffffc0e380a0 (object symbol: lockmod_mutex+0x0)
Mutex OWNER: lockmod-owner PID : 8933
Mutex WAITERS (Index, cpu, comm, pid, state, wait time (d hr:min:sec:ms)):
         [1]: cpu: 0    lockmod-mutex_l  8934     D      0 00:00:06.761  
         [2]: cpu: 0    lockmod-mutex_l  8935     D      0 00:00:06.761  
         [3]: cpu: 0    lockmod-mutex_l  8936     D      0 00:00:06.761  
         [4]: cpu: 0    lockmod-mutex_l  8937     D      0 00:00:06.761  
         [5]: cpu: 0    lockmod-mutex_l  8938     D      0 00:00:06.761  
         [6]: cpu: 0    lockmod-mutex_l  8939     D      0 00:00:06.761  
         [7]: cpu: 0    lockmod-mutex_l  8940     S      0 00:00:06.761  
         [8]: cpu: 0    lockmod-mutex_l  8941     S      0 00:00:06.761  

Scanning Semaphores...

Semaphore: 0xffffffffc0e38040 (object symbol: lockmod_sem+0x0)
Semaphore WAITERS (Index, cpu, comm, pid, state, wait time (d hr:min:sec:ms)):
         [1]: cpu: 0    lockmod-sem_dow  8942     D      0 00:00:06.761  
         [2]: cpu: 0    lockmod-sem_dow  8943     S      0 00:00:06.761  
         [3]: cpu: 0    lockmod-sem_dow  8944     D      0 00:00:06.761  
         [4]: cpu: 0    lockmod-sem_dow  8945     D      0 00:00:06.761  

Scanning RWSemaphores...

Rwsem: 0xffffffffc0e38060 (object symbol: lockmod_rwsem+0x0)
rwsem has no spinners.
Writer owner (struct task_struct *)0xff4ceaeac8bba080: (pid)8933
Rwsem WAITERS (Index, cpu, comm, pid, state, type, wait time (d hr:min:sec:ms)):
         [1]: cpu: 0    lockmod-rwsem_d  8946     D      0 00:00:06.761  
         [2]: cpu: 1    lockmod-rwsem_d  8947     D      0 00:00:06.765  
         [3]: cpu: 1    lockmod-rwsem_d  8948     S      0 00:00:06.765  
         [4]: cpu: 0    lockmod-rwsem_d  8949     D      0 00:00:06.761  
         [5]: cpu: 0    lockmod-rwsem_d  8950     D      0 00:00:06.761  
         [6]: cpu: 0    lockmod-rwsem_d  8951     D      0 00:00:06.761  
         [7]: cpu: 0    lockmod-rwsem_d  8952     D      0 00:00:06.761  
         [8]: cpu: 0    lockmod-rwsem_d  8953     D      0 00:00:06.761  
         [9]: cpu: 0    lockmod-rwsem_d  8954     D      0 00:00:06.761 

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 1, 2024
Mutex owner may not always be present, when there is missing ownership
info, or due to race conditions, or bugs. Don't trigger a fault error in
this case, just print NULL.

Orabug: 37186679
Signed-off-by: Stephen Brennan <[email protected]>
It's useful to know if a lock belongs to a variable, or a slab object,
or something else. The identify_address() function does this for us. Use
it to format the lock information.

Orabug: 37186679
Signed-off-by: Stephen Brennan <[email protected]>
@brenns10 brenns10 requested a review from biger410 October 17, 2024 20:48
@brenns10 brenns10 mentioned this pull request Oct 17, 2024
Copy link
Member

@biger410 biger410 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@brenns10 brenns10 merged commit af48add into oracle-samples:main Oct 30, 2024
5 checks passed
@brenns10 brenns10 deleted the lock_improvements branch October 30, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants