waking up processes while holding spinlock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello dear all!

Suppose, we have the following pseudo code:

spin_lock(&some_lock);
some_func();
spin_unlock(&some_lock);

some_fun()
{
    .....
    wake_up_interruptibe_sync(&wait_queue);
    ....
}
Is this correct behavior or not?

This is a call chain:
wake_up_interruptible_sync ---> wake_up_sync ---> wake_up_common(..., sync=1, ...) ---> ... ---> try_to_wake_up(..., sync=1)
try_to_wake_up invokes resched_task().
As a result, we invoke one thread, while other holds the lock.

Tell me please, my assumption is correct?

--
Regards,
Denis

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux