Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Apr 2014 20:13:37 +0200
From:      Ed Schouten <ed@80386.nl>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Robert Watson <rwatson@freebsd.org>, freebsd-arch@freebsd.org
Subject:   Re: [Patch] kqueue(2) <-> procdesc(4): EVFILT_PROCDESC
Message-ID:  <CAJOYFBCpUw2J_=E3O3zidyJyeqZdHUfmaRt4wbETvnUdpW1q2Q@mail.gmail.com>
In-Reply-To: <CAJOYFBDJy-qJku6Q-hFbh4OzCsqDR8Y=TAYjk6g_W7q9z7pJnA@mail.gmail.com>
References:  <CAJOYFBBBtjRh66YLwgTwRFCXv4SRMD5zgq_bq1UZZvSMKJ9Crw@mail.gmail.com> <20140405153621.GH21331@kib.kiev.ua> <CAJOYFBDJy-qJku6Q-hFbh4OzCsqDR8Y=TAYjk6g_W7q9z7pJnA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On 6 April 2014 17:16, Ed Schouten <ed@80386.nl> wrote:
> My plan was initially to mimick filt_proc() almost entirely and just
> use KNOTE_LOCKED(..., NOTE_EXIT) just like EVFILT_PROC does, but
> unfortunately this doesn't seem possible, because if we went down this
> path, there would be no way for us to activate the knote in
> procdesc_kqfilter() immediately, as KNOTE_ACTIVATE() is not available
> outside of kern_event.c.
>
> This is why I just changed the code, so that procdesc_kqops_event() is
> almost literally a copy of filt_proc(), which the difference that it
> tests against PDF_EXITED instead of using the hint. While there, I
> made some style fixes to filt_proc(). Thoughts?

After looking at the kqueue code in a bit more detail, I think I have
now found a nice middle way. kevent(2) itself will only call into the
kqfilter with hint == 0. I have decided to let procdesc_kqops_event()
be a literal copy of filt_proc(), with the difference that if hint ==
0, it tests against PDF_EXITED.

As it seems to work quite well, I've decided to push this in
(r264231). Thanks for the review!

-- 
Ed Schouten <ed@80386.nl>



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