Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S270500AbTGNCue (ORCPT ); Sun, 13 Jul 2003 22:50:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S270501AbTGNCue (ORCPT ); Sun, 13 Jul 2003 22:50:34 -0400 Received: from mail.jlokier.co.uk ([81.29.64.88]:3733 "EHLO mail.jlokier.co.uk") by vger.kernel.org with ESMTP id S270500AbTGNCud (ORCPT ); Sun, 13 Jul 2003 22:50:33 -0400 Date: Mon, 14 Jul 2003 04:04:37 +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: <20030714030437.GB23110@mail.jlokier.co.uk> References: <20030712181654.GB15643@srv.foo21.com> <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> 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 Content-Length: 861 Lines: 25 Davide Libenzi wrote: > Ouch, I definitely liked more the POLLHUP thing. It is not linked to epoll > at all. POLLRDONCE isn't linked to epoll - it's a valid hint for poll/select too. It means something different, i.e. you can't write: > if (events & EPOLLRDHUP) { > d->flags |= HANGUP; > schedule_removal(d); > } Be careful, because that isn't valid if there is urgent data. You need to check POLLPRI too. Granted urgent data is usually best ignored :) If fast hangup is a useful optimisation too, we should have both flags. (However calling read() doesn't seem like a great penalty for that). -- Jamie - 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/