From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S270506AbTGNDCR (ORCPT ); Sun, 13 Jul 2003 23:02:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S270507AbTGNDCR (ORCPT ); Sun, 13 Jul 2003 23:02:17 -0400 Received: from mail.jlokier.co.uk ([81.29.64.88]:7061 "EHLO mail.jlokier.co.uk") by vger.kernel.org with ESMTP id S270506AbTGNDCN (ORCPT ); Sun, 13 Jul 2003 23:02:13 -0400 Date: Mon, 14 Jul 2003 04:16:14 +0100 From: Jamie Lokier To: Davide Libenzi Cc: "David S. Miller" , Eric Varsanyi , Linux Kernel Mailing List , kuznet@ms2.inr.ac.ru Subject: Re: POLLRDONCE optimisation for epoll users (was: epoll and half closed TCP connections) Message-ID: <20030714031614.GD23110@mail.jlokier.co.uk> References: <20030712222457.3d132897.davem@redhat.com> <20030713140758.GF19132@mail.jlokier.co.uk> <20030713191559.GA20573@mail.jlokier.co.uk> <20030714014135.GA22769@mail.jlokier.co.uk> <20030714022412.GD22769@mail.jlokier.co.uk> <20030714025644.GA23110@mail.jlokier.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Davide Libenzi wrote: > > > Where this will break by using a POLLRDHUP ? > > > > It will break if > > > > (a) fd isn't a socket > > (b) fd isn't a TCP socket > > (c) kernel version <= 2.5.75 > > (d) SO_RCVLOWAT < s > > (e) there is urgent data with OOBINLINE (I think) > Jamie, did you smoke that stuff again ? :) > With Eric patch in the proper places it is just fine. You just make > f_op->poll() to report the extra flag other that POLLIN. What's the problem ? The problem in cases (a)-(e) is your loop will call read() just once when it needs to call read() until it sees EAGAIN. What's wrong is the behaviour of your program when the extra flag _isn't_ set. -- Jamie