Re: [rfc] epoll interface change and glibc bits ...

From: Grant Taylor (gtaylor+lkml_ihdeh111902@picante.com)
Date: Tue Nov 19 2002 - 00:49:16 EST


>>>>> Mark Mielke <mark@mark.mielke.cc> writes:

> We're talking about one extra field to a data structure.

Hmm. As it happens, it looks like Davide is going to err on the side
of the kitchen sink; that neatly makes us both more or less happy,
even if it's still ugly ;)

Meanwhile, in the more important caveat department (Dan, this will
appeal to you), I found a while back that signals cause pain with
epoll.

For example, sometimes TCP reads return EAGAIN when in fact they have
data. This seems to stem from the case where the signal is found
before the first segment copy (from tcp.c circa 1425, there's even a
handy FIXME note there). If you use epoll and get an EAGAIN, you have
no idea if it was a signal or a real empty socket unless you are also
very careful to notice when you got a signal during the read.

        do {
                struct sk_buff * skb;
                u32 offset;

                /* Are we at urgent data? Stop if we have read anything. */
                if (copied && tp->urg_data && tp->urg_seq == *seq)
                        break;

                /* We need to check signals first, to get correct SIGURG
                 * handling. FIXME: Need to check this doesnt impact 1003.1g
                 * and move it down to the bottom of the loop
                 */
                if (signal_pending(current)) {
                        if (copied)
                                break;
                        copied = timeo ? sock_intr_errno(timeo) : -EAGAIN;
                        break;
                }

                /* Next get a buffer. */

                skb = skb_peek(&sk->receive_queue);
                do {
        

-- 
Grant Taylor - gtaylor<at>picante.com - http://www.picante.com/~gtaylor/
   Linux Printing Website and HOWTO:  http://www.linuxprinting.org/
-
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/



This archive was generated by hypermail 2b29 : Sat Nov 23 2002 - 22:00:26 EST