Joachim Worringen wrote:
> Greetings,
>
> the generic poll interface VOP_POLL() in the kernel passes the 'anyyet' 
> parameter to the drivers poll() function. My understanding is that this 
> should help the driver for the "no events found" case to decide if it 
> needs to do a pollwakeup() once an event comes in: if 'anyyet' is 0, the 
> process depends on it to get woken up [1].
>
> This does i.e. mean that the driver needs to turn on interrupts to 
> actually be informed on events on the device. If 'anyyet' was non-zero, 
> this overhead could be avoided.
>
> However, it seems (from looking at uts/common/syscall/poll.c), 'anyyet' 
> can never become a non-zero value as all VOP_POLL() calls pass 0. What's 
> the rationale of this (in case it applies)?
>   

This is done because polled fds are being cached. The poll cache
mechanism requires "registering" the polled device. The subsequent
poll() call won't poll each device but rely on a bitmap of fds that has
pending polled events (hence, a big scalability win). The correctness
of this poll() syscall implementation requires devices being cached
*always* call pollwakeup() when polled events occur.

Jarrett

> Is there any high-level documentation on the pollcache implementation 
> (besides the code comments, which are pretty helpful already)?
>
>   thanks, Joachim
>
> [1] 
> http://src.opensolaris.org/source/xref/volo/volo-gate-103/usr/src/uts/common/syscall/poll.c#1255
>
>   

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to