Skip to content

Make ZFS optional as a shared library #1009

@wkozaczuk

Description

@wkozaczuk

ZFS is one of the three filesystems that OSv implements and had been ported from FreeBSD. ZFS is one of the best file systems for persistent mutable data and what ones needs to run mysql or elasticsearch on OSv for example. Although a lot of effort has gone into integrating ZFS into OSv, its sheer code base volume makes OSv kernel bigger than it needs to be and there are plethora of stateless use cases like redis, memcached, miscroservices, etc where ZFS is not needed and instead we can use ROFS now. ZFS-less kernel is expected to be at least 1MB smaller, which should make OSv images smaller, use less memory and boot slightly faster. So it would be nice to make it optional as a shared library.

To that purpose I have created a branch where I simply commented ZFS-related code from 7 files (mostly in Makefile). There is already libzfs.so artifact that we could reuse and make target of all ZFS code.

There is obviously a question how OSv would exactly initialize ZFS. First of if ZFS optional, I am not sure, we would want to support pivoting to ZFZ (make ZFS partition root). I am not even sure, if it is possible. In that case OSv would either boot with ROFS or RAMFS and then optionally mount ZFS if found in fstab at /data or something. Obviously libzfs.so and any other related ZFS tools would have to be present on ROFS or RAMFS (provided we still support BOOTFS).

With this approach we would not have to duplicate ZFS tools (mkfs.so, etc) anymore in kernel (bootfs) and in ZFS partition and only load what is needed in memory. Given this approach would make OSv always depend on ROFS ((except ramfs images) it would be nice to make ROFS compress-able and possibly implement some memory utilization improvements.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions