Re: CONFIG_PREEMPT is not set

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

 



On Thu, Oct 15, 2009 at 12:44 AM, Leonidas . <leonidas137@xxxxxxxxx> wrote:
> On Wed, Oct 14, 2009 at 7:52 PM, vinit dhatrak <vinit.dhatrak@xxxxxxxxx> wrote:
>> On Wed, Oct 14, 2009 at 7:43 PM, vinit dhatrak <vinit.dhatrak@xxxxxxxxx> wrote:
>>> On Wed, Oct 14, 2009 at 7:39 PM, Leonidas . <leonidas137@xxxxxxxxx> wrote:
>>>> On Wed, Oct 14, 2009 at 6:56 AM, vinit dhatrak <vinit.dhatrak@xxxxxxxxx> wrote:
>>>>> On Wed, Oct 14, 2009 at 4:34 PM, Leonidas . <leonidas137@xxxxxxxxx> wrote:
>>>>>> On Wed, Oct 14, 2009 at 3:34 AM, Leonidas . <leonidas137@xxxxxxxxx> wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I am running Ubuntu Jaunty currently, with kernel version 2.6.28 kernel.
>>>>>>> I was assuming that, all the kernels above 2.6 will have CONFIG_PREEMPT
>>>>>>> =1 by default, but my default kernel does not have it set.
>>>>>>>
>>>>>>> Is that the norm? I can understand certain use cases which might require
>>>>>>> the kernel to be non pre-emptible but even a regular desktop distro does
>>>>>>> not have it set? Surprising?
>>>>>>>
>>>>>>> -Leo.
>>>>>>>
>>>>>>
>>>>>>
>>>>>> Even the vmware image which I use for development does not have
>>>>>> CONFIG_PREEMPT=1.
>>>>>> though it says kernel is SMP.
>>>>>>
>>>>>> #uname -a
>>>>>>
>>>>>> Linux ubuntu-vm 2.6.27.2 -generic #1 SMP Thu Aug 28 17:20:02 UTC 2008
>>>>>> i686 GNU/Linux
>>>>>>
>>>>>> -Leo.
>>>>>>
>>>>>> --
>>>>>> To unsubscribe from this list: send an email with
>>>>>> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
>>>>>> Please read the FAQ at http://kernelnewbies.org/FAQ
>>>>>>
>>>>>>
>>>>>
>>>>> Ok so I can see 3 option for setting preemption model while building kernel,
>>>>>
>>>>> 1) CONFIG_PREEMPT_NONE 2) CONFIG_PREEMPT_VOLUNTARY (default)
>>>>> 3) CONFIG_PREEMPT (might be Ubuntu specific because I can not see this
>>>>> in vanila kernel)
>>>>>
>>>>>
>>>>> So by default on Ubuntu (Desktop), CONFIG_PREEMPT_VOLUNTARY is
>>>>> selected not CONFIG_PREEMPT
>>>>>
>>>>> The difference between symbol exported by these 2 kernels is,
>>>>>
>>>>> 1) Ubuntu (CONFIG_PREEMPT_VOLUNTARY) (You can see some symbols by kvm
>>>>> also but you can ignore them)
>>>>>
>>>>> vinitd@pe-lt271:~$ cat /proc/kallsyms | grep preempt
>>>>> c0121550 T preempt_notifier_register
>>>>> c0121580 T preempt_notifier_unregister
>>>>> c012a350 t check_preempt_curr_idle
>>>>> c012ab50 t check_preempt_curr_rt
>>>>> c012ac50 t check_preempt_wakeup
>>>>> c045a8f0 r __ksymtab_preempt_notifier_unregister
>>>>> c045a8f8 r __ksymtab_preempt_notifier_register
>>>>> c045ed3c r __kcrctab_preempt_notifier_unregister
>>>>> c045ed40 r __kcrctab_preempt_notifier_register
>>>>> c0460612 r __kstrtab_preempt_notifier_unregister
>>>>> c046062e r __kstrtab_preempt_notifier_register
>>>>> c0477824 D preempt_mark_thresh
>>>>> f8fc8a68 d kvm_preempt_ops      [kvm]
>>>>> c0121550 u preempt_notifier_register    [kvm]
>>>>> c0121580 u preempt_notifier_unregister  [kvm]
>>>>> f8d46000 t lp_preempt   [lp]
>>>>> vinitd@pe-lt271:~$
>>>>>
>>>>>
>>>>> 2) Vanilla kernel (CONFIG_PREEMPT)
>>>>>
>>>>> # cat /proc/kallsyms | grep preempt
>>>>> c00258f4 t svc_preempt
>>>>> c00407a8 t check_preempt_curr_rt
>>>>> c00407d4 t check_preempt_curr_idle
>>>>> c0040ce0 T sub_preempt_count
>>>>> c0040d8c T add_preempt_count
>>>>> c00441b8 t check_preempt_wakeup
>>>>> c0308c84 T preempt_schedule_irq
>>>>> c0308d00 T preempt_schedule
>>>>> c03b3a70 r __ksymtab_add_preempt_count
>>>>> c03b3a78 r __ksymtab_sub_preempt_count
>>>>> c03b3a88 r __ksymtab_preempt_schedule
>>>>> c03ba5c7 r __kstrtab_add_preempt_count
>>>>> c03ba5d9 r __kstrtab_sub_preempt_count
>>>>> c03ba5f4 r __kstrtab_preempt_schedule
>>>>> #
>>>>>
>>>>>
>>>>> Hope this will help you.
>>>>>
>>>>> -Vinit
>>>>>
>>>>
>>>> CONFIG_PREEMPT is universal.
>>>>
>>>> If you look at the definition of preemptible(), it will be clear.
>>>>
>>>> -Leo.
>>>>
>>>
>>> What do you mean by universal? Do you mean always TRUE?
>>>
>>> -Vinit
>>>
>>
>> You can read about CONFIG_PREEMPT_VOLUNTARY at,
>>
>> http://kernel.xc.net/html/linux-2.6.18/i386/PREEMPT_VOLUNTARY
>> http://kerneltrap.org/node/3440
>>
>> -Vinit
>>
>
>
> By universal I meant, CONFIG_PREEMPT should be available on vanilla
> kernel as well as Ubuntu kernels.
>
> If you look here,
> http://lxr.linux.no/linux+*/include/linux/hardirq.h#L114
>
> you will see that config_preempt is part of vanilla kernel too. If it is not set
> then preemptible() will be 0x0, means your kernel is not preemptible.
>
> -Leo.
>

You are right, CONFIG_PREEMPT and CONFIG_PREEMPT_VOLUNTARY both are
available in vanilla kernel. But its distribution specific decision
not to enable CONFIG_PREEMPT in their kernel package. Its really
interesting to read the difference between these 2 flags.
CONFIG_PREEMPT_VOLUNTARY is also preempting the kernel but not as much
as CONFIG_PREEMPT.

The possible reason for not enabling CONFIG_PREEMPT can be found here,

http://lists.mandriva.com/kernel-discuss/2009-02/msg00027.php
http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/2845

-Vinit

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