From owner-freebsd-current@freebsd.org Mon May 10 08:29:04 2021 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03C856305DC for ; Mon, 10 May 2021 08:29:04 +0000 (UTC) (envelope-from theraven@theravensnest.org) Received: from smtp.theravensnest.org (smtp.theravensnest.org [45.77.103.195]) (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) by mx1.freebsd.org (Postfix) with ESMTPS id 4FdvNG61wnz4sQM for ; Mon, 10 May 2021 08:29:02 +0000 (UTC) (envelope-from theraven@theravensnest.org) Received: from [192.168.1.227] (host86-137-90-14.range86-137.btcentralplus.com [86.137.90.14]) by smtp.theravensnest.org (Postfix) with ESMTPSA id 38D5B7C80 for ; Mon, 10 May 2021 09:28:56 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=theravensnest.org; s=20171231; t=1620635336; bh=n/Kx27SMo9W6iQjAn2VCLYlT+SjJ+K29xDeyNjCcqrs=; h=Subject:To:References:From:Date:In-Reply-To; b=MjRRnPa0CTrj2USmDuhPiPtO6cImvsqNnn000wUVCdD74W41tXXulDS9Unv/d8pqB zytMJ2iXcOGM9y2CA5jQuQjhN0cw5oCVCrDkHhfiCs1CDfwHe2K/xel32CFKezkfyV MC7em8/QbdrMvbYgwwza5EE4uzrEdWrfwPUZEKrs= Subject: Re: WSLg update on 1-5-2021 - BSD / WSL To: freebsd-current@freebsd.org References: <0b3d6049-f6eb-f9d4-5f20-f09ac666e949@nomadlogic.org> <92a81582-7bd4-b9f1-04b6-cbcd5eb77893@FreeBSD.org> From: David Chisnall Message-ID: Date: Mon, 10 May 2021 09:28:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FdvNG61wnz4sQM X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=theravensnest.org header.s=20171231 header.b=MjRRnPa0; dmarc=none; spf=pass (mx1.freebsd.org: domain of theraven@theravensnest.org designates 45.77.103.195 as permitted sender) smtp.mailfrom=theraven@theravensnest.org X-Spamd-Result: default: False [-3.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+a:smtp.theravensnest.org]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[theravensnest.org:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[45.77.103.195:from]; ASN(0.00)[asn:20473, ipnet:45.77.96.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[86.137.90.14:received]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[theravensnest.org:s=20171231]; FREEFALL_USER(0.00)[theraven]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[theravensnest.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[45.77.103.195:from:127.0.2.255]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-current] X-Mailman-Approved-At: Mon, 10 May 2021 15:47:01 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 May 2021 08:29:04 -0000 On 09/05/2021 04:55, Daniel Nebdal wrote: > On Thu, 6 May 2021 at 19:05, David Chisnall wrote: >> [ Disclaimer: I work for Microsoft, but not on WSL and this is my own >> opinion ] >> (...) >> David >> > > Just as a counterpoint to Rozhuk's take, that all sounds sensible > enough to me - FreeBSD would probably gain more from this than MS. > > So the WSL2 TODO would be something like this: > * Ballooning driver. Seems like a proof of concept would be doable > enough - could you model it as an unkillable task (userland or kernel) > that wants to allocate a lot of memory, and anything it gets it hands > back to the host? There's an in-tree Xen balloon driver that works in this way: it allocates pages of memory from the kernel and then returns them to the hypervisor. It appears that Hyper-V actually supports two kinds of dynamic memory, the balloon interface and a mechanism based on hotplug. The balloon mechanism effectively defines a maximum amount of physical memory and lets the guest return some of it. The hotplug mechanism boots with a smaller amount of memory but can dynamically add and remove physical memory. I don't know which is used in WSL2. > * Some sort of boot support. Maybe as a shim that chainloads an > unmodified kernel? Probably finicky, but also self-contained. To start, you could kexec the FreeBSD kernel from a minimal Linux install. > * File systems. Is / also 9p-over-HyperV-channels? If so that's kind > of crucial and perhaps the hardest part. I think WSL2 provides a block device for /, which is why Linux-native filesystem performance is faster than WSL1. It would be great to have a ZFS image instead of ext4 here! > Oh, and how does the terminal work? You support multiple ttys, so I > guess it's not straight emulated serial? I believe that WSL2 uses SSH connections, rather than exposing the serial terminal. David