From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 29 17:22:09 2015 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 452CA424 for ; Sun, 29 Mar 2015 17:22:09 +0000 (UTC) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 05E2FDD1 for ; Sun, 29 Mar 2015 17:22:09 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 6241BB8058; Sun, 29 Mar 2015 19:22:07 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 4CEFC28494; Sun, 29 Mar 2015 19:22:07 +0200 (CEST) Date: Sun, 29 Mar 2015 19:22:07 +0200 From: Jilles Tjoelker To: Konstantin Belousov Subject: Re: kevent behavior Message-ID: <20150329172207.GC95224@stack.nl> References: <550A6DA2.1070004@gmail.com> <20150324221541.GA67584@stack.nl> <20150325090041.GY2379@kib.kiev.ua> <20150325223530.GA79065@stack.nl> <20150326214551.GG2379@kib.kiev.ua> <20150326225826.GA97319@stack.nl> <20150327132654.GJ2379@kib.kiev.ua> <20150329150316.GB95224@stack.nl> <20150329160338.GZ2379@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150329160338.GZ2379@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@FreeBSD.org, Ivan Radovanovic X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2015 17:22:09 -0000 On Sun, Mar 29, 2015 at 07:03:38PM +0300, Konstantin Belousov wrote: > On Sun, Mar 29, 2015 at 05:03:16PM +0200, Jilles Tjoelker wrote: > > On Fri, Mar 27, 2015 at 03:26:54PM +0200, Konstantin Belousov wrote: > > > +Otherwise, i.e. if > > > +.Fa nevents > > > +is zero, the call is not cancellable. > > > > > +Cancellation can only occur when the call was blocked and no changes > > > +to the queue were requested. > > > > This is not how the code works, but I think the code is correct. The > > code also allows cancellation before anything happens. As such, if > > cancellation occurs at kevent(2), the kqueue's state is unchanged (from > > that call). > Below is only a new diff for the man pages changes. I found our list > of the cancellation points in the pthread_testcancel(3), but did not > checked it for correctness. Given that the special case for fcntl() is mentioned in pthread_testcancel(3) (only a cancellation point if cmd is F_SETLKW), the same should be done for kevent(). Looks good to me otherwise. -- Jilles Tjoelker