Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Feb 2014 09:46:52 -0800
From:      John-Mark Gurney <jmg@funkthat.com>
To:        Kohji Okuno <okuno.kohji@jp.panasonic.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: About kevent
Message-ID:  <20140228174651.GP47921@funkthat.com>
In-Reply-To: <20140228.212908.344599447475200780.okuno.kohji@jp.panasonic.com>
References:  <20140228.111358.1991189164034042401.okuno.kohji@jp.panasonic.com> <20140228071619.GO47921@funkthat.com> <20140228.212908.344599447475200780.okuno.kohji@jp.panasonic.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Kohji Okuno wrote this message on Fri, Feb 28, 2014 at 21:29 +0900:
> > 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...
> 
> 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.

Ok, good, that means the documentation in knlist_clear(9) is correct...

Thanks for verifing this for me...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140228174651.GP47921>