Re: smp/non-smp kernel

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

 



On Fri, 2007-03-09 at 06:20 +0000, my linux wrote:
> 
> On 3/8/07, Arjan van de Ven <arjan@xxxxxxxxxxxxx> wrote:
>         On Tue, 2007-03-06 at 11:25 +0000, my linux wrote:
>         > Hi,
>         >
>         > How can I know  whether my machine booted with SMP and
>         non-SMP
>         > kernel ?   ( from kernel space)
>         
>         that sounds like a weird thing to care about; drivers or
>         anything but 
>         deep architecture code really shouldn't have this knowledge!
>         
>         (for example preempt kernels basically make you have the same
>         rules as
>         smp anyway)
> 
> 
> #ifdef CONFIG_SMP
>         lock_kernel(); 
> #endif
> 
> #ifdef CONFIG_PREEMPT
>         preempt_disable();
> #endif
> 
> Is equivalant to 
> 
>         lock_kernel();
>         preempt_disable();
> 
> in UP/SMP and preempt/non-preempt configuration ? 

no, in fact your ifdefs are really incorrect.
the kernel makes those things no-ops IF THEY ARE. But your lock_kernel()
ifdef for example is really wrong if preempt is enabled!

(also, don't use lock_kernel() in new code anyway)

-- 
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at 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