Got a dead lock ? No idea how you got there ? Why don't you put the ID of the owner of the lock in the lock word ? Here is your patch for IA-64. Doesn't cost any additional instruction, you can have it in your "production" kernel, too. The current task pointers are identity mapped memory addresses. I shift them to the right by 12 bits (these bits are always 0-s). In that way, addresses up to 16 Tbytes can fit into the lock word. Interrupt handlers use the current task pointers as IDs, too. An interrupt handler has to free all the locks it has taken, therefore using the same ID as the task pre-empted uses, is not confusing. Locks which are taken with / without interrupt disabling form two distinct sets. If you are back into the pre-empted task and should there is a "left over" lock with the ID of the task => you've got a hint ;-) In debug mode, you can check if the lock is yours before setting it free: #define spin_is_mine(x) ((x)->lock == (__u32)((__u64) current >> 12)) Good luck. Zoltán Menyhárt