From nobody Mon Jan 10 08:55:39 2022 X-Original-To: freebsd-arch@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 7CA641936003 for ; Mon, 10 Jan 2022 08:56:38 +0000 (UTC) (envelope-from list@johnericson.me) Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4JXSP15c8gz3MyV for ; Mon, 10 Jan 2022 08:56:37 +0000 (UTC) (envelope-from list@johnericson.me) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id D10563201EA6 for ; Mon, 10 Jan 2022 03:56:36 -0500 (EST) Received: from imap44 ([10.202.2.94]) by compute4.internal (MEProxy); Mon, 10 Jan 2022 03:56:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=johnericson.me; h=mime-version:message-id:date:from:to:subject:content-type; s= fm2; bh=CD/isUhBrG7lB5S2SzFkAGdhGKVHbfqRsuJYJ6XW7Tk=; b=OSqcLYVZ oFE9wDYwK7Ezhdlxb/v6Cpq7CWmqyCwVMxJogmD1nZEuyet+Nkf2tD17bQ6FKwN+ BTQvgUUuccaQHKr5QkLVfpU7Z7QrIDD+bdFs7GTwwbs/6fsc21aJ12tY0HZlVTck FATZCXFWbIfEVJ7lDQt8tX1WV4KJN6qOpPrKy/UqFSpopE5G9+gRiT/ohZjuJBo1 yyi6nzgiDSfXvLDnZQNQlvPMp+bisXaEAwaTg4iea8bnii3ZyGLyIw5s8OPROXIH B7sCftr562ADvNKbeM6thPOhjohiPeLytv7vrRwXxI8S0z0CuIt9nrBFwYDoMkLq SBpAyLAFZFjpBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=CD/isUhBrG7lB5S2SzFkAGdhGKVHb fqRsuJYJ6XW7Tk=; b=Z6WjjFjiAOShDUhBtLBMPefakGXsApkdV086/gQ1YDaEM Qi08t+WIAhZAC7oUkkUzpl46Ca9hCgF6/43/pzmMhEdPcigGEQ2OVROxtLRTNaU+ gx8/aYqW2h9qkXtPIYCpQMz0CO8OWLvL0Y9NXhSJX3cdszaTQiPEYPbWRYJxfFu9 Ty02S/SVBvBqIZOeJeQkG7cXybuh2zqKEFOw44iqdzUsxrU7ibTNWwipWdTKeSxZ e11sjZNGp5+EuwdZYg+uSd9bX0Ht6XB69pafW3ea625MPI3cjN6XE1+svh1w+uc0 5utML84xmWx+Fq02ZPmzEaM/ZcvWU7l/AKBNBQMOg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudegledguddvlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkfffhvffutgesthdtre dtreertdenucfhrhhomhepfdflohhhnhcugfhrihgtshhonhdfuceolhhishhtsehjohhh nhgvrhhitghsohhnrdhmvgeqnecuggftrfgrthhtvghrnhepudeifeekffetffelffehgf ehteffhedvfffhgefgueetveeigeejtdfhkeejtefhnecuffhomhgrihhnpegtrghtvghr nhdrtghomhdpkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheplhhishhtsehjohhhnhgvrhhitghsohhnrdhmvg X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 1DD2AFA0AA6; Mon, 10 Jan 2022 03:56:36 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-4527-g032417b6d6-fm-20220109.002-g032417b6 List-Id: Discussion related to FreeBSD architecture List-Archive: https://lists.freebsd.org/archives/freebsd-arch List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arch@freebsd.org Mime-Version: 1.0 Message-Id: Date: Mon, 10 Jan 2022 03:55:39 -0500 From: "John Ericson" To: freebsd-arch@freebsd.org Subject: Leveraging process descriptors for process creation without fork Content-Type: text/plain X-Rspamd-Queue-Id: 4JXSP15c8gz3MyV X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=johnericson.me header.s=fm2 header.b=OSqcLYVZ; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=Z6WjjFji; dmarc=none; spf=pass (mx1.freebsd.org: domain of list@johnericson.me designates 64.147.123.20 as permitted sender) smtp.mailfrom=list@johnericson.me X-Spamd-Result: default: False [-4.09 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[johnericson.me:s=fm2,messagingengine.com:s=fm1]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:64.147.123.20:c]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arch@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DWL_DNSWL_LOW(-1.00)[messagingengine.com:dkim]; RCVD_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[johnericson.me]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[johnericson.me:+,messagingengine.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RWL_MAILSPIKE_POSSIBLE(0.00)[64.147.123.20:from]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:29838, ipnet:64.147.123.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[64.147.123.20:from] X-ThisMailContainsUnwantedMimeParts: N Hi, I have long been interested in seeing an alternative to fork+exec implemented in a real-world Unix OS. What I have in mind is: 1. Load an executable into a fresh new unscheduled process (we might call this an "embryonic" process) 2. Set file descriptors and other state on that process 3. Submit it to the scheduler I am far from the first person to think of this interface, of course. Since becoming interested in this, I have been referred to this paper[1], which very nicely describes the concept in detail, and also evaluates an all-userspace implementation of it. I must admit I first emailed the Linux mailing list about this.[2] The reception was positive, but the multitude of other features[3] supported in the relevant code makes refactoring it to elegantly implement both the existing and new interfaces a rather large task. I checked, and FreeBSD's fork and exec code is, surprise surprise, a great deal simpler, and therefore a better venue for demonstrating this feature's viability. Also, as I am interested in the feature in the context of efforts like Capsicum and CloudABI, FreeBSD is a natural starting point for cultural and historical reasons. I am under no illusion that, even with FreeBSD's comparative simplicity, I will have time to finish this project in the near future, but I hope it is still OK to discuss the merits of the idea itself. Thanks, John [1]: http://catern.com/rsys21.pdf [2]: https://lore.kernel.org/lkml/f8457e20-c3cc-6e56-96a4-3090d7da0cb6@JohnEricson.me/T/#m6be1994668e6f34837496c86f37f9fe52bfae990 [3]: Especially binfmt_misc, if anyone was curious