Re: kernel preemption does not work

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

 



Hi Guys,

I am not sure whether this API is avialable to user space but this
code snippet is part of Kernel module.

> >  Test code:
> >  --------------
> >  read()
> >  {
> >    if(down_interruptible())
> >            return error;
> >    mdelay(10000);
> >    up();
> >  }
> >
> >  With this code in place, I try to do a 'CTRL+C' when it hangs at that delay.
> >  It does not respond to my 'CTRL + C'.
>
> Is that user space or kernel space code?

This is my my read implementation of char driver routine i.e. a scull_read.
With the above code in place, when it hangs in the kernel at mdelay(),
a 'CTRL+C' does not preempt the kernel process and give back  the
control to terminal prompt.
The kernel only gives control back after the delay is complete.
I was thinking CTRL+C should generate a preemption signal to kernel.
If not, I would like to know what are those signals that can trigger a
preemption in kernel mode.

Does it take more that just enabling 'CONFIG_PREEMPT' to enable a
preemptive kernel.

Regards,
Bhanu J

>
> regards,
>
> Mulyadi
>

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