From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2265 Path: news.gmane.org!.POSTED!not-for-mail From: Konstantin Belousov Newsgroups: gmane.os.freebsd.devel.hackers,gmane.comp.sysutils.supervision.general Subject: Re: NOTE_TRACK, EVFILT_PROC, kqueue, and subreapers Date: Mon, 12 Dec 2016 13:12:18 +0200 Message-ID: <20161212111218.GB54029@kib.kiev.ua> References: <20161201125438.15230317@mydesk.domain.cxm> <20161206104020.6b2ebb30@eto-mona.office.smartweb.sk> <20161206102637.1ddd152a@mydesk.domain.cxm> <20161207155638.4b2dd629@eto-mona.office.smartweb.sk> <630ace89-e29b-d0d3-9f15-110d8dc3de08@NTLWorld.com> <20161208132842.5d7940bd@eto-mona.office.smartweb.sk> <20161211124637.GA17315@stack.nl> <20161211175451.GV54029@kib.kiev.ua> <20161211222328.GC17315@stack.nl> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1481541160 32662 195.159.176.226 (12 Dec 2016 11:12:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Dec 2016 11:12:40 +0000 (UTC) User-Agent: Mutt/1.7.1 (2016-10-04) Cc: FreeBSD Hackers , Jonathan de Boyne Pollard , supervision@list.skarnet.org To: Jilles Tjoelker Original-X-From: owner-freebsd-hackers@freebsd.org Mon Dec 12 12:12:35 2016 Return-path: Envelope-to: freebsd-hackers@m.gmane.org Original-Received: from mx2.freebsd.org ([8.8.178.116]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGOX0-0007Gf-Cq for freebsd-hackers@m.gmane.org; Mon, 12 Dec 2016 12:12:30 +0100 Original-Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 7B65F65F9F; Mon, 12 Dec 2016 11:12:33 +0000 (UTC) (envelope-from owner-freebsd-hackers@freebsd.org) Original-Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id F39B811F; Mon, 12 Dec 2016 11:12:32 +0000 (UTC) (envelope-from owner-freebsd-hackers@freebsd.org) Original-Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C464C723A8 for ; Mon, 12 Dec 2016 11:12:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Original-Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7B231FB9 for ; Mon, 12 Dec 2016 11:12:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Original-Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id uBCBCIJR089927 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 12 Dec 2016 13:12:18 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uBCBCIJR089927 Original-Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id uBCBCIqk089926; Mon, 12 Dec 2016 13:12:18 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Content-Disposition: inline In-Reply-To: <20161211222328.GC17315@stack.nl> X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: owner-freebsd-hackers@freebsd.org Original-Sender: owner-freebsd-hackers@freebsd.org Xref: news.gmane.org gmane.os.freebsd.devel.hackers:58324 gmane.comp.sysutils.supervision.general:2265 Archived-At: On Sun, Dec 11, 2016 at 11:23:28PM +0100, Jilles Tjoelker wrote: > On Sun, Dec 11, 2016 at 07:54:51PM +0200, Konstantin Belousov wrote: > > On Sun, Dec 11, 2016 at 01:46:38PM +0100, Jilles Tjoelker wrote: > > > As reported in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213928 > > > reapers do not receive SIGCHLD when inheriting zombies, although they do > > > receive SIGCHLD when an inherited descendant process later terminates > > > and are awakened when in a wait call for a matching process. This should > > > probably be fixed. > > I agree, in principle. Could you update your tests/sys/kern/reaper.c to > > include this scenario ? > > I tested with the patch below. The new test case > reaper_sigchld_child_first already passes and I have marked > reaper_sigchld_grandchild_first as an expected timeout. > > > Untested change to the kernel side is below. > > > diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c > > index f4f453c3556..92899740eef 100644 > > --- a/sys/kern/kern_exit.c > > +++ b/sys/kern/kern_exit.c > > @@ -455,6 +455,12 @@ exit1(struct thread *td, int rval, int signo) > > > > if (!(q->p_flag & P_TRACED)) { > > proc_reparent(q, q->p_reaper); > > + if (q->p_state == PRS_ZOMBIE) { > > + PROC_LOCK(q->p_reaper); > > + pksignal(q->p_reaper, SIGCHLD, q->p_ksi); > > + wakeup(q->p_reaper); > > + PROC_UNLOCK(q->p_reaper); > > + } > > } else { > > /* > > * Traced processes are killed since their existence > > This change makes reaper_sigchld_grandchild_first pass. > > The wakeup added here is redundant with the one a few lines above: > if (q != NULL) /* only need this if any child is S_ZOMB */ > wakeup(q->p_reaper); I removed additional wakeup, it should be innocent. Might be the better change is to remove the lines you cited above and do wakeups inside the loop after reparenting. But I kept it that way for now. > > This is also clear because reaper_wait_grandchild_first already passes. > > Index: tests/sys/kern/reaper.c Thank you, I verified that all tests pass with the patched kernel and removed timeouts from your reaper_sigchld_*child_first new tests. The kernel chunk is committed as r309886, please commit tests. _______________________________________________ freebsd-hackers@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"