Re: how to get chance for user space process even when the kernel is utilizing 100% CPU.

2008-02-01 Thread Lennart Sorensen
On Fri, Feb 01, 2008 at 11:41:48PM +0530, veerasena reddy wrote:
> I have a requirement where i need to execute a user process even when the 
> kernel is utilizing 100% of CPU time.
> 
> Actual scenario is as below:
> i have a device on my board. this device keeps generating regular (for every 
> 2secs) messages for a user process. the user process has to poll on the 
> device for any message is there to read and get the message from the device. 
> once the user process reads the message it will be removed in device and uses 
> for further/subsequent messages.
> 
> I have a test case where i need to send so much traffic through my board such 
> that the kernel will be utilizing 100% CPU time to process this data. At this 
> time (when CPU is 100% utilized) the user space process is not getting 
> scheduled even after a long duration (say 10 minutes to 45 minutes). Mean 
> time the message buffer in the device is filled up and the device halts (aka 
> controlled crash; the device firmware has been designed like this) as there 
> is no more memory on the device.
> 
> To avoid this scenario of device's message queue getting filled up because of 
> the user space process not reading them, could you please anyone suggest some 
> technique for getting my user space process scheduled even when there is very 
> heavy traffic as described above.
> 
> In simple, i can put my requirement like this:
> Is there any way i can get a user space process get scheduled in the 
> above condition (kernel occupying 100% of CPU due to heavy traffic)

The simple answer is that you made a design mistake.  If the CPU can't
keep up with the data then you picked the wrong cpu for the job.

The more complex answer is that you probably really need a realtime
system where you can set guarenties on the scheduler time for a given
task, even at the expense of the kernel.

On the system I work on we had to make sure the 4 ethernet ports didn't
overload the CPU, and we actually have the ethernet driver check the
system cpu percentage over a small interval and if it goes over a
specified percentage, then the port will stop processing incoming
packets for one jiffy, giving some time for user space tasks.  It's a
bit of an ugly hack, but it sure works well.

--
Len Sorensen
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: how to get chance for user space process even when the kernel is utilizing 100% CPU.

2008-02-01 Thread Chris Snook

veerasena reddy wrote:

I have a requirement where i need to execute a user process even when
the kernel is utilizing 100% of CPU time.


In the realtime kernel, hardware interrupt handlers are prioritized 
threads, so you can give the userspace process a higher realtime priority.


-- Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


how to get chance for user space process even when the kernel is utilizing 100% CPU.

2008-02-01 Thread veerasena reddy
Hi,

I have a requirement where i need to execute a user process even when the 
kernel is utilizing 100% of CPU time.

Actual scenario is as below:
i have a device on my board. this device keeps generating regular (for every 
2secs) messages for a user process. the user process has to poll on the device 
for any message is there to read and get the message from the device. once the 
user process reads the message it will be removed in device and uses for 
further/subsequent messages.

I have a test case where i need to send so much traffic through my board such 
that the kernel will be utilizing 100% CPU time to process this data. At this 
time (when CPU is 100% utilized) the user space process is not getting 
scheduled even after a long duration (say 10 minutes to 45 minutes). Mean time 
the message buffer in the device is filled up and the device halts (aka 
controlled crash; the device firmware has been designed like this) as there is 
no more memory on the device.

To avoid this scenario of device's message queue getting filled up because of 
the user space process not reading them, could you please anyone suggest some 
technique for getting my user space process scheduled even when there is very 
heavy traffic as described above.

In simple, i can put my requirement like this:
Is there any way i can get a user space process get scheduled in the above 
condition (kernel occupying 100% of CPU due to heavy traffic)

Thanks in Advance.

Regards,
Veerasena.


  Bollywood, fun, friendship, sports and more. You name it, we have it on 
http://in.promos.yahoo.com/groups  

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


how to get chance for user space process even when the kernel is utilizing 100% CPU.

2008-02-01 Thread veerasena reddy
Hi,

I have a requirement where i need to execute a user process even when the 
kernel is utilizing 100% of CPU time.

Actual scenario is as below:
i have a device on my board. this device keeps generating regular (for every 
2secs) messages for a user process. the user process has to poll on the device 
for any message is there to read and get the message from the device. once the 
user process reads the message it will be removed in device and uses for 
further/subsequent messages.

I have a test case where i need to send so much traffic through my board such 
that the kernel will be utilizing 100% CPU time to process this data. At this 
time (when CPU is 100% utilized) the user space process is not getting 
scheduled even after a long duration (say 10 minutes to 45 minutes). Mean time 
the message buffer in the device is filled up and the device halts (aka 
controlled crash; the device firmware has been designed like this) as there is 
no more memory on the device.

To avoid this scenario of device's message queue getting filled up because of 
the user space process not reading them, could you please anyone suggest some 
technique for getting my user space process scheduled even when there is very 
heavy traffic as described above.

In simple, i can put my requirement like this:
Is there any way i can get a user space process get scheduled in the above 
condition (kernel occupying 100% of CPU due to heavy traffic)

Thanks in Advance.

Regards,
Veerasena.


  Get the freedom to save as many mails as you wish. To know how, go to 
http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


how to get chance for user space process even when the kernel is utilizing 100% CPU.

2008-02-01 Thread veerasena reddy
Hi,

I have a requirement where i need to execute a user process even when the 
kernel is utilizing 100% of CPU time.

Actual scenario is as below:
i have a device on my board. this device keeps generating regular (for every 
2secs) messages for a user process. the user process has to poll on the device 
for any message is there to read and get the message from the device. once the 
user process reads the message it will be removed in device and uses for 
further/subsequent messages.

I have a test case where i need to send so much traffic through my board such 
that the kernel will be utilizing 100% CPU time to process this data. At this 
time (when CPU is 100% utilized) the user space process is not getting 
scheduled even after a long duration (say 10 minutes to 45 minutes). Mean time 
the message buffer in the device is filled up and the device halts (aka 
controlled crash; the device firmware has been designed like this) as there is 
no more memory on the device.

To avoid this scenario of device's message queue getting filled up because of 
the user space process not reading them, could you please anyone suggest some 
technique for getting my user space process scheduled even when there is very 
heavy traffic as described above.

In simple, i can put my requirement like this:
Is there any way i can get a user space process get scheduled in the above 
condition (kernel occupying 100% of CPU due to heavy traffic)

Thanks in Advance.

Regards,
Veerasena.


  Get the freedom to save as many mails as you wish. To know how, go to 
http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


how to get chance for user space process even when the kernel is utilizing 100% CPU.

2008-02-01 Thread veerasena reddy
Hi,

I have a requirement where i need to execute a user process even when the 
kernel is utilizing 100% of CPU time.

Actual scenario is as below:
i have a device on my board. this device keeps generating regular (for every 
2secs) messages for a user process. the user process has to poll on the device 
for any message is there to read and get the message from the device. once the 
user process reads the message it will be removed in device and uses for 
further/subsequent messages.

I have a test case where i need to send so much traffic through my board such 
that the kernel will be utilizing 100% CPU time to process this data. At this 
time (when CPU is 100% utilized) the user space process is not getting 
scheduled even after a long duration (say 10 minutes to 45 minutes). Mean time 
the message buffer in the device is filled up and the device halts (aka 
controlled crash; the device firmware has been designed like this) as there is 
no more memory on the device.

To avoid this scenario of device's message queue getting filled up because of 
the user space process not reading them, could you please anyone suggest some 
technique for getting my user space process scheduled even when there is very 
heavy traffic as described above.

In simple, i can put my requirement like this:
Is there any way i can get a user space process get scheduled in the above 
condition (kernel occupying 100% of CPU due to heavy traffic)

Thanks in Advance.

Regards,
Veerasena.


  Bollywood, fun, friendship, sports and more. You name it, we have it on 
http://in.promos.yahoo.com/groups  

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: how to get chance for user space process even when the kernel is utilizing 100% CPU.

2008-02-01 Thread Chris Snook

veerasena reddy wrote:

I have a requirement where i need to execute a user process even when
the kernel is utilizing 100% of CPU time.


In the realtime kernel, hardware interrupt handlers are prioritized 
threads, so you can give the userspace process a higher realtime priority.


-- Chris
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: how to get chance for user space process even when the kernel is utilizing 100% CPU.

2008-02-01 Thread Lennart Sorensen
On Fri, Feb 01, 2008 at 11:41:48PM +0530, veerasena reddy wrote:
 I have a requirement where i need to execute a user process even when the 
 kernel is utilizing 100% of CPU time.
 
 Actual scenario is as below:
 i have a device on my board. this device keeps generating regular (for every 
 2secs) messages for a user process. the user process has to poll on the 
 device for any message is there to read and get the message from the device. 
 once the user process reads the message it will be removed in device and uses 
 for further/subsequent messages.
 
 I have a test case where i need to send so much traffic through my board such 
 that the kernel will be utilizing 100% CPU time to process this data. At this 
 time (when CPU is 100% utilized) the user space process is not getting 
 scheduled even after a long duration (say 10 minutes to 45 minutes). Mean 
 time the message buffer in the device is filled up and the device halts (aka 
 controlled crash; the device firmware has been designed like this) as there 
 is no more memory on the device.
 
 To avoid this scenario of device's message queue getting filled up because of 
 the user space process not reading them, could you please anyone suggest some 
 technique for getting my user space process scheduled even when there is very 
 heavy traffic as described above.
 
 In simple, i can put my requirement like this:
 Is there any way i can get a user space process get scheduled in the 
 above condition (kernel occupying 100% of CPU due to heavy traffic)

The simple answer is that you made a design mistake.  If the CPU can't
keep up with the data then you picked the wrong cpu for the job.

The more complex answer is that you probably really need a realtime
system where you can set guarenties on the scheduler time for a given
task, even at the expense of the kernel.

On the system I work on we had to make sure the 4 ethernet ports didn't
overload the CPU, and we actually have the ethernet driver check the
system cpu percentage over a small interval and if it goes over a
specified percentage, then the port will stop processing incoming
packets for one jiffy, giving some time for user space tasks.  It's a
bit of an ugly hack, but it sure works well.

--
Len Sorensen
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/