lkml.org 
[lkml]   [2004]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: poll() in 2.6 and beyond


On Wed, 3 Mar 2004, Linus Torvalds wrote:
>
> You should clear the "events pending" flag only when you literally remove
> the event (ie at "read()" time, not at "poll()" time). Because the
> select() code _will_ call down to the "poll()" functions multiple times if
> it gets woken up for any bogus reason.

Hmm.. The above is all still true and your poll() implementation is bad,
but looking at your test program, the problematic case really shouldn't
trigger (we should call poll() multiple times only when it returns zero).

To trigger that bug, you'd have to occasionally call poll() with the
POLLIN bit clear in the incoming events, which your test program doesn't
ever do.

Anyway, you should move the clearing to read(), but there may well be
something else going on too.

What's the frequency you are programming the thing to send interrupts at?

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-11-18 23:46    [W:0.047 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site