Re: while(1) in init_module()

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

 



Hello Rajaram....

> Yes !,  I saw that this flag is not set in the .config file.
OK then, try to enable CONFIG_PREEMPT, recompile your kernel and 
re-execute your test....and see what will happen ;)

> but for me, the keyboard and mouse went off ! even the on/off
> 

IMHO, what you see is actually the Linux kernel is "delaying" the 
application-level handling of the interrupt. In other word, interrupts 
are still accepted like usual (let's say keyboard interrupt), but when 
the characters want to be displayed in your console (another 
assumption), the kernel needs to wake up your current process, right? 
And that means preempting your insmod which is still in kernel mode 
doing tight while(1) loop

> I tried putting schedule() inside init_module(). Now it did
> not hang the system. I could proceed with other processes, but only
> the insmod never returned. But I did not try your suggestion of
> another process and nice value etc.. So in this case the init_module
> is run in time slices just to call schedule() again and voluntarily
> give up the CPU..is it ? btw..what is mpg 123 ?

schedule() voluntarily calls scheduler to pick another runnable task, in 
other word you are simulating the effect of enabling CONFIG_PREEMPT, 
only this time you are doing this by your own.

I hope you got the idea now :)

NB: mpg123 is command line based mp3 player ;)

regards

Mulyadi


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