Fedora Linux Support Community & Resources Center
  #1  
Old 29th September 2011, 01:25 PM
kalzoubi Offline
Registered User
 
Join Date: Apr 2011
Posts: 27
linuxfirefox
F11 freezes

Hi,

I am using F11 (Kernel 2.6.30). My application reads data from A/D card once the card sends IRQ interrupt. Those interrupts are received once every 40 ms, if the system in the acquisition mode.

In this case, I have a module loaded to the kernel to handle those interrupts. Once an interrupt is received the module sends a signal to the my application in the user space (the code showed below).

The PROBLEM is that after data acquisition for a bout an hour Linux freezes (i.e. cannot use mouse, keyboard, etc).

One of the solutions I tried is to boot the kernel with the "noapic" option. This caused the system to hangs after about 4 hours of data acquisition. Perhaps, because my IRQ is now handled by only CPU0 as shown in file /proc/interrupts (i.e. my system has two CPUs).

How to work around this problem.

Please note that my IRQ handler in the kernel module is written as follows, in case I have a problem with it:

static irqreturn_t e5000_irq_handler(int irq, void *dev_id, struct pt_regs * regs) {
struct siginfo info;
struct task_struct *tsk = NULL;
memset(&info, 0, sizeof (struct siginfo));
info.si_signo = SIGUSR1;
info.si_code = SI_KERNEL;

rcu_read_lock();
tsk = find_task_by_vpid(Acq_Data_PID);
rcu_read_unlock();

if (tsk != NULL) {
send_sig_info(SIGUSR1, &info, tsk);
}
return IRQ_HANDLED;
}
Reply With Quote
  #2  
Old 29th September 2011, 01:57 PM
leigh123linux's Avatar
leigh123linux Offline
Retired Administrator
 
Join Date: Oct 2006
Posts: 21,509
linuxredhatfirefox
Re: F11 freezes

Moved to EOL (End Of Life) Versions
Reply With Quote
  #3  
Old 29th September 2011, 02:41 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,106
linuxfedorafirefox
Re: F11 freezes

May not have anything to do with the problem.

How does the memory usage track?

Curious... why does the driver not read the D/A converter itself?
Reply With Quote
  #4  
Old 29th September 2011, 03:55 PM
kalzoubi Offline
Registered User
 
Join Date: Apr 2011
Posts: 27
linuxfirefox
Re: F11 freezes

Hi,

Using the "ps aux" command the application process memory usage stays at 0.2 %. However, the CPU usage keeps increasing. For example, in 30 mins the CPU usage increased from 1.2 % to about 16.2% (just before the system hangs).

To answer your question, I read the data in the user space since I need to process and view it to the user anyway. Do you think I should have this module read and buffer the data. After that signal the application. Will that matters.

Thanks
Reply With Quote
  #5  
Old 29th September 2011, 06:57 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,106
linuxfedorafirefox
Re: F11 freezes

Personally, I think it would get better use to have the driver read the D/A and put it in a buffer for the application.

If the application is not real time (and displaying to a user isn't real time), then having an application thread open a file descriptor and read data (blocking on the read when there is no data) would have less overhead. Once the application unblocks (data available) it can process one or more samples at once without having to block for each sample.

Less overhead - no signal delivery, catching signal, then reading data... with the possibility of missing signals (too slow) and missing data values (added to input buffer instead).

Will this fix your problem? don't know - it may depend on what is actually going wrong. It would seem to be a memory leak (but in the kernel, not userspace), but I can't tell.

stevea is more likely to have an idea, I believe he works in embedded systems and so is more familiar with kernel behavior there.
Reply With Quote
  #6  
Old 4th October 2011, 07:24 PM
kalzoubi Offline
Registered User
 
Join Date: Apr 2011
Posts: 27
linuxfirefox
Re: F11 freezes

Thanks much for the inputs. Although, I like your idea so I'll keep it. However, it didn't fix my problem.

I observed that the USB stick does not flash once inserted during system hanging. To me, this means that it is not detected by the hardware. Could it be a hardware problem?
Reply With Quote
  #7  
Old 13th October 2011, 02:17 PM
kalzoubi Offline
Registered User
 
Join Date: Apr 2011
Posts: 27
linuxfirefox
Re: F11 freezes

Thanks again. Sorry due to none related issues, I thought your suggestion didn't fix my problem, but it did. Thus, the problem was because of sending a signal from the driver module.

Regards,
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
F10 KDE Freezes Jamwa Using Fedora 7 3rd July 2009 07:37 AM
Anaconda freezes -- really freezes LinGreg Installation and Live Media 1 8th December 2008 04:23 PM
F9 freezes jr_ Using Fedora 5 9th October 2008 04:42 PM


Current GMT-time: 11:21 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat