RE: Clarification required about select vs wake_up race condition

From: Ravinandan Arakali \(rarakali\)
Date: Wed Mar 14 2007 - 12:34:05 EST


Hi,
Our driver is not in the kernel tree yet.
The code snippet from poll entry point is as follows:

mask = 0;
poll_wait(filp, &(sap_desc->recv_any_wq), poll_table);
/* We don't have yet a waiting queue for writers... */
lock_mts();
if ((sap_desc->recv_q.first != NULL) &&
(block_ssync_event(sap_desc->recv_q.first) == FALSE)) {
/* The queue can be read. */
mask |= POLLIN | POLLRDNORM;
}
unlock_mts();
//MTS_HOOK(mts_syscall_exit,__FUNCTION__,mask);
return mask;

The wake_up_interruptible(&(sap_desc->recv_any_wq)) is executed
from the sending process.

Hope this is sufficient. As I mentioned in my previous mail, what I
am trying to understand better is the kernel code path of do_select()
versus wake_up_interruptible.

Thanks,
Ravi

-----Original Message-----
From: Arjan van de Ven [mailto:arjan@xxxxxxxxxxxxx]
Sent: Wednesday, March 14, 2007 4:08 AM
To: Ravinandan Arakali (rarakali)
Cc: linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: Clarification required about select vs wake_up race
condition

On Mon, 2007-03-12 at 12:44 -0700, Ravinandan Arakali (rarakali) wrote:
> Hi,
> I am facing following problem and was wondering if somebody could help

> me out.
> Our char driver(pretty much like all other char drivers) does a
> poll_wait()


you forgot to include your (full) sourcecode or a pointer to that...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/