Check for a spin lock in the core core

I am trying to parse the spinlock variable inside the kernel kernel of the Linux kernel. In the case of a mutex, if the mutex was locked, the variable count should be set to 0. In the case of spin-lock spinlock_t my_lock has fields such as

(struct raw_spinlock) rlock
      (arch_spinlock_t) raw_lock
            (unsigned int) lock 
      (unsigned int) break_lock

Integer variables have a value of 0. Would they have a different value if a lock were made? Is there another way to check in a dump for a variable spin lock to make sure it was taken? Is architecture dependent significance?

+4
source share
3 answers

die() spin_lock spinlock, traps.c, die() . 1 . .

. .

0

spin_is_locked()

( spinlock.h)

0

. , spin_is_locked() . , , spin_lock(). , . , spin_lock() - , , .

0

Source: https://habr.com/ru/post/1569673/


All Articles