Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752116AbcCKUbP (ORCPT ); Fri, 11 Mar 2016 15:31:15 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:33012 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750987AbcCKUbL (ORCPT ); Fri, 11 Mar 2016 15:31:11 -0500 MIME-Version: 1.0 Reply-To: mtk.manpages@gmail.com In-Reply-To: <56E1DBC2.6040109@akamai.com> References: <56A9C03B.7020104@gmail.com> <56AA56A2.3000700@akamai.com> <56AB1F6C.7000609@gmail.com> <56E1C2B5.2040905@akamai.com> <56E1D1D7.8040000@gmail.com> <56E1DBC2.6040109@akamai.com> From: "Michael Kerrisk (man-pages)" Date: Fri, 11 Mar 2016 21:30:49 +0100 Message-ID: Subject: Re: [PATCH] epoll: add exclusive wakeups flag To: Jason Baron Cc: Andrew Morton , Ingo Molnar , Peter Zijlstra , Al Viro , Eric Wong , Madars Vitolins , Jonathan Corbet , Andy Lutomirski , Linus Torvalds , Hagen Paul Pfeifer , lkml , "linux-fsdevel@vger.kernel.org" , Linux API Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1140 Lines: 37 >> By the way, in the code you have >> >> case EPOLL_CTL_MOD: >> if (epi) { >> if (!(epi->event.events & EPOLLEXCLUSIVE)) { >> epds.events |= POLLERR | POLLHUP; >> error = ep_modify(ep, epi, &epds); >> } >> >> I think the "if" here is redundant. IIUC, earlier in the code you >> disallow EPOLL_CTL_MOD with EPOLLEXCLUSIVE. >> >> Cheers, >> >> Michael >> >> > > Hi Michael, > > So the previous check ensures that you can not add the EPOLLEXCLUSIVE > flag to the events via an EPOLL_CTL_MOD operation, where EPOLLEXCLUSIVE > may not be the existing events set. While this check here ensure you > can't modify an existing set that already has the EPOLLEXCLUSIVE flag. Hmmm - I misread the code, itr seems :-/. Could you please carefully check the man page text I sent earlier in this thread. Maybe I injected some errors into the text. Thanks, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/