Re: Can I use semaphore inside spinlock?

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

 



Hello, Jon.

Thank you for your reply.

On 10/11/05, Jon Masters wrote:
> On 10/11/05, Tetsuo Handa wrote:
> > Can a process do semaphore operations while the process is
> > holding a spinlock?
> No. Well, you might wake something up later.
OK.

> > This will sleep and cause deadlock, won't this?
> No. The BKL gets silently released and reacquired without you noticing
> it is happening.
So, as with lock_kernel(), I don't need to worry releasing the lock
before doing semaphore operations or kmalloc(GFP_KERNEL).
And as with dcache_lock, for example, I need to release the lock
before doing semaphore operations or kmalloc(GFP_KERNEL).

Thank you very much.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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