LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-20-2009, 01:32 PM   #1
CelticBlues
LQ Newbie
 
Registered: Jan 2005
Posts: 29

Rep: Reputation: 15
disabling interrupts to approach RT performance?


Please advise if this question is OT. (If so, where can I post it or read more about said topic?)

I have an application that grabs frames from a frame grabber. It is dropping frames, sometimes, 30 frames at a time. I suspect this is occuring due to background tasks or something like that interupting the app. In the future I may go to a hard RT linux, but for now, I just have time to try to reduce the number and frequency of frame drops.
I read on some linux websites that one can disable interrupts to increase performance and/or reduce latencies.
My questions are

1. Is this an acceptable practice? If not, what are my other options?

2. How can I do this?
Would I use:
void local_irq_save(unsigned long flags);
void local_irq_restore(unsigned long flags);


3. What interupts should I consider disabling?


CB
 
Old 01-20-2009, 08:16 PM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
I think it is On Topic

How many frames do you have in a second, and how much processing do you have to do for each frame? And how much does that keep your processor occupied? Could it be that your own application is too busy and drops frames.

In a multi-tasking OS like Linux it is said that you can never be sure when your task is being scheduled. However, my experience is that a normal running task can run very much uninterrupted when only being interrupted by system tasks.

If you start disabling interrupts you might very well be interfering with the performance of you Linux system.

What process uses the most time? Are you nearing a limit of CPU usage?

One of the first things I would try is to unnice your frame grabber program.

e.q.:

Code:
nice -20 myframegrabber
You can also renice your program thru top.

jlinkels
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Interrupts rhcohen Programming 5 12-21-2017 11:25 AM
Interrupts mrchsreddy Linux - Newbie 2 11-18-2008 06:27 PM
LXer: Performance Technologies Announces Availability of AMC121 High-Performance Comp LXer Syndicated Linux News 0 09-18-2007 10:30 AM
BIOS Interrupts Orkie Programming 3 04-22-2005 09:23 AM
about interrupts eshwar_ind Programming 1 02-25-2004 12:38 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration