From owner-freebsd-current@FreeBSD.ORG Fri Feb 28 12:29:17 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A5FDAC3 for ; Fri, 28 Feb 2014 12:29:17 +0000 (UTC) Received: from smtp.mei.co.jp (smtp.mei.co.jp [133.183.100.20]) by mx1.freebsd.org (Postfix) with ESMTP id 2D1881611 for ; Fri, 28 Feb 2014 12:29:16 +0000 (UTC) Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile12) with ESMTP id s1SCT88g024298; Fri, 28 Feb 2014 21:29:08 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili11) with ESMTP id s1SCT8R12218; Fri, 28 Feb 2014 21:29:08 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi17) id s1SCT8T1004200; Fri, 28 Feb 2014 21:29:08 +0900 Received: from localhost by lomi17.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id s1SCT8vk004186; Fri, 28 Feb 2014 21:29:08 +0900 Date: Fri, 28 Feb 2014 21:29:08 +0900 (JST) Message-Id: <20140228.212908.344599447475200780.okuno.kohji@jp.panasonic.com> To: jmg@funkthat.com Subject: Re: About kevent From: Kohji Okuno In-Reply-To: <20140228071619.GO47921@funkthat.com> References: <20140228.111358.1991189164034042401.okuno.kohji@jp.panasonic.com> <20140228071619.GO47921@funkthat.com> Organization: Panasonic Corporation X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org, okuno.kohji@jp.panasonic.com X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 12:29:17 -0000 > Kohji Okuno wrote this message on Fri, Feb 28, 2014 at 11:13 +0900: >> I have a question about kevent. >> >> How should the userland judge knote which is cleared from knlist by >> knlist_clear() or knlist_delete()? > > It looks like I need to read the code better... knlist_clear (killkn=0) > and knlist_delete (killkn=1) are wrappers around knlist_cleardel... > > Looking at the code of knlist_cleardel, if killkn is set > (knlist_delete) the knote will be dropped (free'd)... if it is not set, > the flags _EOF and _ONESHOT will be set such that it'll be returned > soon.. > > Now that I look at the code, KNOTE_ACTIVATE is never called to be put > on the list to be delivered, so now I'm not sure if it works the way > it's suppose to... I have a feeling that the notes might hang around > forever until the kq fd is closed... > > I'm also puzzled as to why _DETACHED isn't set, which would seem to > mean that we'll call f_detach when we close the kq, which I assume > could cause a panic... > > This needs to be investigated/tested... > > -- > John-Mark Gurney Voice: +1 415 225 5579 > > "All that I will do, has been done, All that I have, has not." Hi, Thank you for your comment. I tried test by usb_dev. When a USB device is lost suddenly, I can receive EV_EOF|EV_ONESHOT on kevent->flags. Regards, Kohji Okuno