From owner-freebsd-arch@FreeBSD.ORG Mon Dec 1 22:43:28 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5540EB4A for ; Mon, 1 Dec 2014 22:43:28 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtpout002.mac.com [17.172.220.237]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A8F6320 for ; Mon, 1 Dec 2014 22:43:27 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTPSA id <0NFX00I6BDS5BO60@st11p02mm-asmtp002.mac.com> for arch@freebsd.org; Mon, 01 Dec 2014 22:43:19 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2014-12-01_05:2014-12-01,2014-12-01,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1408290000 definitions=main-1412010216 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: Process reapers From: Rui Paulo In-reply-to: <20141201185237.GC97072@kib.kiev.ua> Date: Mon, 01 Dec 2014 14:43:17 -0800 Content-transfer-encoding: quoted-printable Message-id: <2BBA8329-C8F4-452D-B6C2-E129FCD6D666@me.com> References: <20141201185237.GC97072@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1993) Cc: arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 22:43:28 -0000 On Dec 1, 2014, at 10:52, Konstantin Belousov = wrote: >=20 > Please find at https://www.kib.kiev.ua/kib/reaper.6.patch > the patch which adds a way for the process to declare itself a reaper > for the subtree of processes forked after the event. In other words, > after the process is marked as reaper, all orphaned children somewhere > in subtree after the reaper, are reparented to the process instead of > init(8). >=20 > The API is based on the following DragonFlyBSD commit > = http://gitweb.dragonflybsd.org/dragonfly.git/commit/fc3bc2868ad212f3b412ad= 13f0eaa35b3f8d458d > Linux has somewhat similar prctl(PR_SET_CHILD_SUBREAPER). > Solaris is most advanced in the area, the feature which provides > the same function is contracts(4), which is very advanced and > IMO over-designed interface. >=20 > I did not wrote the man page, the API is still in flux. It should > be relatively clean how to use the thing by the descriptive names > and comments in header file. One of the test programs illustrating > the interface is available at https://www.kib.kiev.ua/kib/reaper2.c . > See http://leaf.dragonflybsd.org/cgi/web-man?command=3Dprocctl§ion=3D= 2 > for the description of DragonFly interface. >=20 > The feature was requested by bapt, jilles already provided useful > feedback that was incorporated into the patch. >=20 > Please review and comment. One comment I have is that we could rename the variables to something = more meaningful instead of "p1" or "p2". If "p1" is the reaper, we = could call it "p_reaper". -- Rui Paulo