From nobody Fri Sep 5 17:57:30 2025 X-Original-To: dev-commits-src-main@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 4cJPFQ61h7z65vbX; Fri, 05 Sep 2025 17:57:30 +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 4cJPFQ5LwHz4Hgh; Fri, 05 Sep 2025 17:57:30 +0000 (UTC) (envelope-from jamie@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757095050; 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=5+jMfh3cjaMj/NqI/8G0Zo6dp3TvcG9mahiB0Z+UEfs=; b=Dj9aId6JbZ44ungWc+2TJUC51OGKxPHiLEpf9UCZjiZFcrFiWDrPRHwVjoXzJDlifNwH+o /4ZJv39eZJxfCDwQEsyJjoakVYlW/TiF9yeOa8Y2qqjQEx+L7N8OBc87//MN/Uo0OTUyQw J+N3kLxP69ghcTKRQj76EiHySJvze3XWNeOoq/xWdUPpzncMfuFpIksoA2kff6UJ3EZ+wu uQOYP0VO7J6punNcOqWYDfvXzufuPhpLUKewvitkBMohcez4heOQ71xhzV7lqzjwQSH4eb mBwUlpSZTjuR91LVhZHukyN66wCQ8x7F3DpE0YkAKjmst9PlEWaFVMhVa8BZ9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757095050; 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=5+jMfh3cjaMj/NqI/8G0Zo6dp3TvcG9mahiB0Z+UEfs=; b=jFxoHLKdBmDiFqhWhF+e/qxd3q6eLWcVKqajsGgXGUe/rFtAQEPDb9H23QR5Q84V0xlZQP /yd1rCTEEZgD7vThD3LXpH30VrIPFy1SgnyqyDl1IPWkT9IIw+PIamZzEbuXIDdnX6f6sW TH62qBMVdna6CLYuJjWluewr4P9Oy5Xr1SsZeNbK6CuJ09hULXQoFWAQt90oA6dpDGHaMg ALr2WWJl8HntUvU3/GMNCWoz6hACRZoycoyBGua0sbiFNPaSX7WhTgr3C+iL6SejWQF+/R +PLU7UsGISZF1Rd8LYW9FTZDi6CWMX2tFn+Locb/Y0WBpp6Nt59k4+3A9LkoVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757095050; a=rsa-sha256; cv=none; b=iqSjWawoPAZc+00Vt8OPwRV683OqRpMSplhTEpYswi+WIh/rsUOwU3u0+/85qEaMdxGuL8 saSWzs2fYrxn4bgxh6ebLLyUnAmwKoe0gDQhaOcnL0VLwQh3GXyDyZbutnMse77pnzRK+u Pz1lkDpUvNFomgBZAgZuNnPA2gz1+aOv44TzzDUC2Fn+BW2Z/8X/6LSTOEnVMYJrPMx5Nh JrnWpi2Eo8TA5dvlOCL99h3GnVbVAg6BzmBupLLHmr0M9PX4YzgzLwgq7djgEYZJXaT9mX fP60P9ePGQvgoaDzBuuF1qlIsEmqjDJYuBXee2wajvjm4Uqg5rN7RBvLSgtVNg== 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 4cJPFQ4Z2Wz14tm; Fri, 05 Sep 2025 17:57:30 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (localgritton [127.0.0.212]) by m2.gritton.org (Postfix) with ESMTPSA id 587537A24A; Fri, 5 Sep 2025 10:57:30 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Date: Fri, 05 Sep 2025 10:57:30 -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> Message-ID: <2f66c886ab44aea5ad2e57cc72c03e3f@freebsd.org> X-Sender: jamie@freebsd.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit On 2025-09-04 22:14, Konstantin Belousov wrote: > BTW, you added some support for kqueue for jail events, but not to the > jail file descriptors. This seems to be backward: if somebody wants to > monitor events for jails, then it is more reliable and straightforward > to do with the new jail fds rather than with ids. It is at least incomplete, and not the state I want things to be at. There's a sticking point with jaildesc kqueue, so while I work that out I went with jid-baseds kqueue as a starter. The trouble is child jails. I took their handling from the existing child process handling, where I register a new kevent under the new jail's id. But that's something I can't do with descriptors, since they have a process-specific identifier, the descriptor number. The code that creates the new event, coming from the jail_set call that created a new jail, has access to the global descriptor (the struct file), but not to the process(es) that have it open, so I have no way of registering one or more events with that descriptor number. One workaround is to have both jid- and jaildesc-based kevents, but both of them register a new jid-based kevent for a newly created child jail. The caller may then get a descriptor with jail_get, and add a kevent for it and remove the old jid-based one. This would work, but feels really klunky. The other idea I've had is to register a temporary event, and then add code to kqueue_scan that converts that into a proper jaildesc event with the expected file descriptor number. That would require either jaildesc-specific code in or around kqueue_scan, or adding another filterops function, neither of which is great. Still, it seems the better solution. With working jaildesc kevent support, the jid-based kevents would be unnecessary, so if I can get this done before 15 is released, they can go away. - Jamie