Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-26-2010, 12:37 PM   #1
LQ Newbie
Registered: Nov 2009
Posts: 6

Rep: Reputation: 0
Process going to "D" state because of semaphore

I've a device driver that provides two ioctl calls: one for writing to the device & the other for reading from the device.
Both these ioctl cases use the same semaphore for synchronization.
There is a read process that invokes the read ioctl every 1 sec. There is a write process that invokes write ioctl pretty fast comparatively (3-4 times a second).
My observation is that after sometime, the read process goes to the "D" (uninterrupted sleep state). After inserting debug messages I'm seeing that it goes to this state after invoking the "down" system call at the beginning of read ioctl. And it never recovers.
The write process does not stop, it runs continuously.
If write process is killed, then also read process does not recover.

Same behavior is seen even when down_trylock and down_interruptible function calls are used.

Any hints?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Need solution to "failed to fork PTY" and "error creating the child process" problems Gnusboy Linux - Newbie 4 01-02-2010 08:54 AM
"TOP" Command keeps going to "stopped" state mudtoe Linux - Newbie 3 03-10-2009 12:15 AM
ns:"error when calling class OldSim"&tclsh:"invalid command+child process exits abn." shojaru Linux - Newbie 0 03-05-2009 05:23 AM
How to read "identify" button press event, or state of "identify" blue led with IPMI? iav Linux - Server 0 01-27-2009 02:13 PM
ALSA + slmodemd + "semaphore not ready" + no modem noise cyberjun Linux - Laptop and Netbook 21 04-06-2005 02:39 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:12 AM.

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