Re: UDP recvmsg blocks after select(), 2.6 bug?

From: Chris Friesen
Date: Thu Oct 07 2004 - 12:28:56 EST


Mark Mielke wrote:

Isn't it more expensive to allow the
application to be woken up, and poll using read(), than to just do a
quick check in the kernel and not tell the application there is data,
when there really isn't?

The issue is caching.

We have to do a pass over the data to copy it to userspace. If we do the checksum verification then, it's basically free since its already in the cache.

If we do it at select() time, we end up having to do two passes over every packet, one to verify the checksum, and one to pass it to userspace.

I agree with you though, it'd be nice to have select() change behaviour based on whether the socket is blocking or not.

Chris
-
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/