Peter Teoh wrote:
On Thu, Apr 10, 2008 at 3:32 PM, bhanu nani <[EMAIL PROTECTED]> wrote:
Hi all,
I am trying to test kernel preemption in my driver. When I first
compiled the Linux kernel and tested it, I found it to be
non-preemptible. Later I realised that my kernel was build with
premption disabled. I enabled kernel premption in processort section
i.e. CONFIG_PREEMPT and rebuild it.
First time I read this article:
http://www.linuxdevices.com/articles/AT8211887833.html
and I learned tons a lot.
And this:
http://www.ussg.iu.edu/hypermail/linux/kernel/0403.2/0545.html
So I think advisable NOT to set CONFIG_PREEMPT.
Even with change in the kernel preemption does not work. I am trying
it on my latest stable kernel.
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.
As what Mulyadi has asked, how can u enter ctrl-C to some program that
u write in userspace, and expect it to stop a kernelspace module (from
the API u used above)?
Are u doing some kind of UML?
It does not respond to my 'CTRL + C'.
Where am I missing the preemption thing in the kernel?
Regards,
Bhanu J
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ
Yeah, FWIW, none of the server distros compile preemption in; it's only
really for desktop responsiveness, and even then, I think its value may
be marginal (at this time - I think it will mature). I'm not sure
exactly how it works, but there is also a BIG_KERNEL_LOCK or something
to that effect... that's probably a spinlock thing. I've never ventured
to that part of the code base, yet. Peter, do you know anything about
it? I think it showed up last summer or so as an unstable compile
option. Or, that's the first time I stumbled upon it :)
Are you sure that they keyboard IRQs aren't masked? I think PCI
steering reroutes them to like IRQ 17 or so, but they should be on a
shared IRQ, IIRC.
begin:vcard
fn:Scott Lovenberg
n:Lovenberg;Scott
org:The CleftStone Works
adr:;;;Kutztown;PA;19530;USA
email;internet:[EMAIL PROTECTED]
tel;cell:570-856-2999
note;quoted-printable:Interests:=0D=0A=
Programming, *NIX, Slackware, Samba, C/C++, Perl, Java, .NET, Kernel Hack=
ing, Virtual Machines, FOSS, Security, Operating Systems, Various Softwar=
e Stacks. =
=0D=0A=
=0D=0A=
Always have time for "shop talk"; feel free to drop me a line.
x-mozilla-html:TRUE
url:www.cleftstoneworks.com
version:2.1
end:vcard