Why can down_write() inside lock_kernel() ?

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

 



Hello.

Why it is allowed to call down_write() after lock_kernel() ?
lock_kernel() uses a spinlock and the process must not sleep
until unlock_kernel(), therefore that process must not use
down_write() that might sleep, isn't it ?

Is lock_kernel() a special spinlock and the process can
call semaphore operations and kmalloc(GFP_KERNEL) ?

lock_kernel() at http://lxr.linux.no/source/fs/namespace.c?v=2.4.28#L855
do_mount() at http://lxr.linux.no/source/fs/namespace.c?v=2.4.28#L700
do_add_mount() at http://lxr.linux.no/source/fs/namespace.c?v=2.4.28#L613
down_write() at http://lxr.linux.no/source/fs/namespace.c?v=2.4.28#L631

Regards.

--
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