Re: NOTE_TRACK, EVFILT_PROC, kqueue, and subreapers

2016-12-14 Thread Martin "eto" Misuth
On Tue, 13 Dec 2016 10:49:19 +
Jonathan de Boyne Pollard  wrote:

> Martin "eto" Misuth:
> > Subreaper won't even wake when it acquires new child.  
> 
> You're following the other discussion about this, ne?

I hope meant you this one. 

No my trips into kqueue/kvent land are very very simple ones.
I did some 30 lines examples from net, watched dir, watched socket. 
In the past I did some luajit infested abominations but my memories are hazy
it was probably garbage. However compared to fd of Linux the
whole system makes much more sense to me. 

Currently, in ets6-reaper, I am trying to (ab)use most of skalibs, so I
decided to use iopause().

As it seems iopause() uses select() or (p)poll(). With null timeout, this
"locks" whole reaper, which is intentional. Reparenting happens auto-magically
on kernel side. Only when termination (SIGTERM) or child death (SIGCHLD) signal
comes, thing wakes up and does it's job. This is intentional as I wanted it to
be idle as much as possible. iopause() was chosen because it works on both
platforms I care about.

However for jails, I did really nasty things, I don't want to go into here
exactly, at the moment. But in that context, I am seriously pondering on
using kqueue. Should that ever happen I would be grateful if I was able to
wake up on child reparent event.

One major pain point I still have to deal with, is that I have to use Linux.

  eto


Re: NOTE_TRACK, EVFILT_PROC, kqueue, and subreapers

2016-12-13 Thread Jonathan de Boyne Pollard

Jilles Tjoelker:
This should probably be fixed. 


There's another more insidious bug hiding inside kevent() somewhere that 
causes a kernel abend complaining about a sleeping thread holding a 
non-sleepable lock.  One needs to make fairly heavy use of kevent() in 
order to trigger it, I believe, as I have only seen it so far on systems 
that do.