LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-30-2018, 07:41 PM   #1
drbrains
LQ Newbie
 
Registered: Feb 2018
Posts: 11

Rep: Reputation: Disabled
How to troubleshoot / improve interrupt handler (top / bottom) for performance??


In the device driver I am writing I am not getting the performance I am expecting.

in short:
1. get a request.
2. setting up the hardware.
3. "kick" the hardware and wait for it to complete.
4. return "-EINPROGRESS" to caller.

Hardware IRQ.
Top Half:
1. clear and disable interrupt.
2. schedule taste
3. IRQ_HANDLED

Bottom Half (tasklet):
1. check hardware for completed packets.
2. read output from buffer and clear hardware.
3. if full request was processed signal completed to caller
4. check if more requests are pending.
5. if more requests are pending...

I think the problem is in the last step:
I tried:
a) re-enable interrupt and return (cycle starts again after IRQ)
b) re-schedule tasklet and return (saves time to process IRQ)
c) "loop" inside tasklet (no return).
 
Old 12-10-2018, 11:51 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,141

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Quote:
wait for it to complete
Nothing in the kernel code should ever be waiting for anything. It should all be event-driven.

Quote:
clear and disable interrupt
Top half should process all of the hardware pending requests, queue anything that needs to be handled more slowly, and leave with the interrupts enabled so more hardware requests can arrive. Bottom half should complete anything on the queue that couldn't be handled quickly in the top half. If you are leaving interrupts disabled until the bottom half runs, then the design has a problem, because the bottom half should be running outside of the interrupt context.
 
  


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
Kernel panic: killing interrupt handler! In interrupt handler - not syncing. divyashree Programming 26 05-15-2010 01:27 PM
control is not going to interrupt handler when interrupt remyasj LinuxQuestions.org Member Intro 1 11-12-2009 12:56 AM
control is not going to interrupt handler when interrupt comes in serial driver sateeshalla Linux - Kernel 1 05-04-2006 09:43 AM
<0>Kernel panic: Aiee, killing interrupt handler! In interrupt handler - not syncing mrb Linux - Newbie 2 01-09-2005 09:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 08:34 PM.

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