Re: lock_kernel: why it is empty?

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

 



Le Thu, 27 Dec 2007 09:00:39 +0700,
"Mulyadi Santosa" <mulyadi.santosa@xxxxxxxxx> a écrit :

> What if the user selected CONFIG_SMP and at the same time choose
> voluntary preemption model? does lock_kernel() still expand as void
> function? I guess in SMP we still have to deal with concurrent
> acquisition of lock....

No, in the SMP case, lock_kernel() is of course not empty. Have a look
at include/linux/smp_lock.h. It defines lock_kernel() as empty only if
CONFIG_LOCK_KERNEL is false (otherwise one of the two non-empty
implementations of lock_kernel() in lib/kernel_lock.c is used).

And CONFIG_LOCK_KERNEL is defined in init/Kconfig as follows:

config LOCK_KERNEL
        bool
        depends on SMP || PREEMPT
        default y

So it's true if you are on SMP *or* if you are using full-preemption
(PREEMPT).

Sincerly,

Thomas
-- 
Thomas Petazzoni, thomas.petazzoni@xxxxxxxx, http://thomas.enix.org
Jabber, thomas.petazzoni@xxxxxxxxx
Toulibre, http://www.toulibre.org - APRIL, http://www.april.org
Fingerprint : 0BE1 4CF3 CEA4 AC9D CC6E  1624 F653 CB30 98D3 F7A7

Attachment: signature.asc
Description: PGP signature


[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