Re: WSLg update on 1-5-2021 - BSD / WSL

From: David Chisnall <>
Date: Mon, 10 May 2021 09:28:55 +0100
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 

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.

Received on Mon May 10 2021 - 06:29:04 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:28 UTC