From nobody Wed Sep 10 19:25:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cMVyj2PHqz66lTl; Wed, 10 Sep 2025 19:25:33 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cMVyj1sqLz3p59; Wed, 10 Sep 2025 19:25:33 +0000 (UTC) (envelope-from jamie@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757532333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JBRh1jW3JcLr05TlDsus9lSO21wTTqn1I4Z2qZe8IBE=; b=edXhdzdbxC6DcDXp3LV4eMjG8rTN9BWNpYPGMQwMGOHZCv2gXWR984xcPMID1XRLLlZlFC hzMCyHVmc76ox6tsL4qi8NbHFfnCe/h/ygAOS6nH/qPK9W1lmTVGlZMtj18ulaN00eKSad UOD27RKvnUtFOBxZJzo9HksdD+sK+0Tg10UxjijkZMOLqVWBO37LkFo5W2g3lqH7V6w2Ye 5n0eLelppTmhYRHgIP3uuZdDYwF1hVYprxI7Rl8FegVPI6jCCMKto2oDO7hj2l381k4/cb GAKPW9VZSqpzsF4dzRAqE8RgEuxmDZdiWgRkMl66XxU6gGLmO+Dp1RD57Awwbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757532333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JBRh1jW3JcLr05TlDsus9lSO21wTTqn1I4Z2qZe8IBE=; b=aUZD1Idwa9Mzh5SdPBgycelqxujCaufgx+OpWTDSlZ4Cv6SOrBOLhEXDUCCYm/rWrJCq8C 4BcrDiti+zWeJGGJmZ811PG45W3SIMYNS8CZK/9pJPTkB05viWcluFqeI80V2urMgB3ZpT NcMYSkVe0aeWn3ujtkaUK5ZxTVzItlY/p9HXum00mz2zsfjdWSbnPb+oKsgGrtqt2/zLNL 6hfaJ+NfDAEKPce3nmWGY1jJOxzkmMgfN9lQ/gxR0T0vkZ5Ei2rWGd4oVNAxZiQMRrtE1x x8aoEbJXw3nvXqBds7flcKbLYomc8fbxHwtfvWEQpVORidrRnWt2x5CiUj8ByQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757532333; a=rsa-sha256; cv=none; b=BdqBKGHW4d26Mr5dAIUZw551SUWCVtS2JgbkREMasBgzA8jG3KOwm2nNkKfZcCe2zh02x+ mg3PO2BC5JQEfCA/Y9UmyFYgUTAv8nQvh80GEH3bwvpVmAiQcYqh6opQexfM44OGZENDG7 U90DwQbEgMCqAlAV8b+ij7ozqY0/BCSIm7fgkrroFLBrGum2iPpuS6482uK1mez8ipHZ1x hs8bDtozuUcUoub9os3evZkKpzpwx695Ms8TPw7KQ0M6eTCmKgXHDsvjO6nRJCqA2M4C8+ a9InYBaL8kVyr1bb08M59R2lc3y7aT4Vrln3iCKapaMm62zelYU4a1abdQRquA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from m2.gritton.org (gritton.org [67.43.236.212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jamie) by smtp.freebsd.org (Postfix) with ESMTPSA id 4cMVyj13Y8znGg; Wed, 10 Sep 2025 19:25:33 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (localgritton [127.0.0.212]) by m2.gritton.org (Postfix) with ESMTPSA id 3787C7C680; Wed, 10 Sep 2025 12:25:32 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Date: Wed, 10 Sep 2025 12:25:32 -0700 From: James Gritton To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 851dc7f859c2 - main - jail: add jail descriptors In-Reply-To: References: <202509042031.584KVpxY000408@gitrepo.freebsd.org> <2f66c886ab44aea5ad2e57cc72c03e3f@freebsd.org> <24a1f2413af24eea3fb5e9be9c05c4bd@freebsd.org> Message-ID: <4b63a73ee826d065b6f07771be9c5b37@freebsd.org> X-Sender: jamie@freebsd.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit On 2025-09-10 02:03, Konstantin Belousov wrote: > On Sun, Sep 07, 2025 at 09:25:59AM -0700, James Gritton wrote: >> On 2025-09-06 17:26, Konstantin Belousov wrote: >> > On Fri, Sep 05, 2025 at 10:57:30AM -0700, James Gritton wrote: >> An alternate way of solving the problem would be to create such >> a queue, allowing a single notification of such things as a jail >> attachment or child jail creation, or possibly more than one of >> them by the time the process reads the queue. > > No, the queue is obviously overkill. Still, no notification system > really require the queue. > > I am not thinking too hard what would be a good design for the jail > filedesc, > but I have some ideas that feels worth communicating. > > ... > > Next, for notifications, the notification subsystem does not need to > indicate what happen, in particular, it does not need to communicate > neither the jid of created (or destroyed) jail, nor jfd for it. It is > enough to make the listener aware that something happen. Upon > receiving > the notification, listener would interrogate the system state and see > what changed. > > The proc knotes are very bad example, in particular, the idea to pass > back the pid is wrong. It is known to be racy, both because reported > pids might get lost, and because pids only behave handle-like in the > parent of the forked child, so pid might be reused. > > Proc knote + half-done procdesc is not a good example to start with. I've given the queuing solution at https://reviews.freebsd.org/D52462 and I'm not particularly happy with it. It's too much code that doesn't really solve the problem. https://reviews.freebsd.org/D52461 goes the non-queue direction, mirroring EVFILT_PROC fork. Yes, I could go even simpler, and not worry about trying to report every transition. I could at least do a best-effort reporting, like how the attach notification currently works, with a pid and also a flag that says something was missed the state needs to be re-examined. That doesn't require any supporting infrastructure and still lets things run quickly in the usual case. - Jamie