procfs problem

Mike McCarty mike.mccarty at sbcglobal.net
Thu Aug 4 14:15:20 UTC 2005


Richard Stover wrote:
> I'm not sure if this is the correct list for this question.
> If not perhaps someone can direct me to the correct list.
 >
 > I have a device driver [I've written]...

Seems good enough to me.

I've not got specific experience with FC, but I've developed
drivers for Blue Hat Linux (real time).

>        if (offset == 0) {
^^^^^^^^^^^^^^^^^^^^^^^^^
> 
>            printk("####%s waiting event %x\n",__FUNCTION__,(unsigned 
> int)&dev->read_proc_wait);
> 
>            wait_event_interruptible(dev->read_proc_wait,(offset != 0));
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

These two bits of code look suspicious to me. I'm not familiar
with this particular call, but in combination with that above,
I feel uncomfortable.

[snip]

> I see the blocked process "waiting event..." message and I see the 
> "waking up..."
> message. But I never get the "WOKE UP" message and the waiting process 
> never returns.
> If I kill the waiting process I do see "WOKE UP" and "returns error due 
> to pending signal"
> messages so I know it has in fact been waiting. The address of 
> dev->read_proc_wait
> is the same in both the "waiting event..." and "waking up..." messages.
> I've initialize dev->read_proc_wait just like several other event flags 
> in the
> same device driver: init_waitqueue_head(&(dev->read_proc_wait));
> 
> I can not see any reason why the waiting process wouldn't wake up.
> 
> If anybody has any suggestions I would appreciate the help.

It looks like your analysis is correct. The process is being suspended
It is not being awakened, except by your (manually sent) signal.

I suppose you are not using any lightweight threads. It is remotely
possible that if you are, the wrong thread is getting restarted.
I'm not aware of how FC handles lightweight threads. Some kernels
consider the thread itself to be a schedulable entity, some only
consider the process to be schedulable.

Mike
-- 
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!




More information about the fedora-list mailing list