On 05/12/2010 12:09 AM, Pete Zaitcev wrote:
I observed that Tabled sometimes starts spinning on CPU. It happens when it manages to receive a EOF from client (reads zero bytes from the socket). The fix is to treat EOF as an error and simply dispose of the cli. However, we need to know when there are no bytes to be read from a socket that is still open. To that end we modify the API of cli_read: now it only returns zero in case of EOF, and passes -EAGAIN up. In order to prevent busy spinning for slow clients, callers of cli_read return false to the dispatch loop in case of -EAGAIN. Note that this patch assumes that zero bytes is always EOF, and that we receive -EAGAIN if there is nothing to read in the first place. Signed-off-by: Pete Zaitcev<zaitcev@xxxxxxxxxx>
applied -- To unsubscribe from this list: send the line "unsubscribe hail-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html