* Re: Re: Lowering Latency
@ 2002-12-30 17:24 arun4linux
0 siblings, 0 replies; 2+ messages in thread
From: arun4linux @ 2002-12-30 17:24 UTC (permalink / raw)
To: Roger Larsson; +Cc: linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 2854 bytes --]
<<I assume that the only thing the driver does on an interrupt is to wakeup the application?
>>Yes. it wakes up the sleeping threads.
<<Can the interrupts arrive faster than once per 1/50 s = 20 ms?
>>Yes. But at least 3000 interrupts have to get processed by both ISR and application thread.
<<But it is REQUIRED that your application runs with SCHED_FIFO and its memory locked.
>>Did you mean dynamic memory allocation in the application? or something else?
<<But do not use
schp.sched_priority = sched_get_priority_max(SCHED_FIFO);
since there are generally no SCHED_FIFO processes running and the highest levels should be reserved for really important stuff...
>>I use the SCHED_RR (real-time threads) in the application.
<<What is in the PCI registers that the application uses - data?
>>It uses both the device registers as well as data.
Making the driver smarter is also not possible in our case as we are porting it and we try to imitate another OS as much as possible for code maintanece requirement.
Warm Regards
Arun
"Roger Larsson" wrote:
On Wednesday 25 December 2002 23:09, you wrote:
> <> << latency and not much more.
>
> I need to process a minimum of 3000 interrupts per minute generated by a
> PCI based controller.
> And my development environment is RedHat 8.0. I can't change both of these.
> And the application is tightly coupled with the driver. Driver exports the
> PCI base addresses to the application using mmap and application accesses
> the card directly.
>
> Arun
>
Lets see...
3000 interrupts per minute => 50 per second, should not be a problem in driver
code. But...
I assume that the only thing the driver does on an interrupt is to wakeup the
application? Then you have the need for low latency... What is the worst
case? Can the interrupts arrive faster than once per 1/50 s = 20 ms?
Why I ask is because 20 ms is on the average OK for a standard kernel.
But if you like to use the file system on the same time it will be a problem.
But it is REQUIRED that your application runs with SCHED_FIFO and
its memory locked.
see
http://www.gardena.net/benno/linux/audio/
it is old, the standard kernel is better now. But do not use
schp.sched_priority = sched_get_priority_max(SCHED_FIFO);
since there are generally no SCHED_FIFO processes running and
the highest levels should be reserved for really important stuff...
What is in the PCI registers that the application uses - data? Is it data
acuisition application? If not, try to make the driver smarter - it helps.
/RogerL
--
Roger Larsson
Skellefteå
Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com
Buy the best in Movies at http://www.videos.indiatimes.com
Now bid just 7 Days in Advance and get Huge Discounts on Indian Airlines Flights. So log on to http://indianairlines.indiatimes.com and Bid Now!
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Re: Lowering Latency
@ 2002-12-25 22:09 arun4linux
0 siblings, 0 replies; 2+ messages in thread
From: arun4linux @ 2002-12-25 22:09 UTC (permalink / raw)
To: Roger Larsson; +Cc: linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 2246 bytes --]
<<Your driver latency should not be a problem. It should be interrupt latency and not much more.
>>I need to process a minimum of 3000 interrupts per minute generated by a PCI based controller.
And my development environment is RedHat 8.0. I can't change both of these. And the application is tightly coupled with the driver. Driver exports the PCI base addresses to the application using mmap and application accesses the card directly.
Arun
"Roger Larsson" wrote:
On Tuesday 24 December 2002 16:55, arun4linux wrote:
> Hello,
>
> I'm writing a module device driver on RH 8.0 (2.4.18-14 kernel).
> I'd like to know is there any way I can give maximum priority to my module.
> Or can I make my module a non-preemptable one?
> I could see from drivers/char/oprofile/compat.h that preempt_disable()
doesn't do anything. (Mine is an uniprocessor machine.)
It does in 2.5 kernels. That is why it is a compat in 2.4 :-)
[2.4 does not have kernel preemption unless you add the specific patches]
> I don't want to touch the rest of the kernel. I dont want to apply any
patch.
> All I want to do is get the maximum time from the CPU and lower my driver's
latency.
Your driver latency should not be a problem. It should be interrupt latency
and not much more. Are you sure that it is the drivers latency that is the
problem? How have you come to that conclusion?
(if it is in the milliseconds range then it is not the driver, but driver to
application - and you need a low latency patch)
> Is it possible?
Yes, if that really is the problem. There are two hard RT approaches.
RTLinux and RTAI/Adeos (but it is important to read their respective
licenses...) It it is driver to application those are overkills...
> If it's possible, please do let me know, how to achieve this.
>
> Wishing you all a merry christmas and a prosperous new year.
>
> Arun
>
/RogerL
--
Roger Larsson
Skellefteå
Sweden
Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com
Buy the best in Movies at http://www.videos.indiatimes.com
Now bid just 7 Days in Advance and get Huge Discounts on Indian Airlines Flights. So log on to http://indianairlines.indiatimes.com and Bid Now!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-12-30 17:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-30 17:24 Re: Lowering Latency arun4linux
-- strict thread matches above, loose matches on Subject: below --
2002-12-25 22:09 arun4linux
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®