Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

History
133 lines (96 loc) · 6.6 KB

File metadata and controls

133 lines (96 loc) · 6.6 KB

Integration in upstream kernel

Introduction

Work for submit patches to upstream it's a lot (see 1 2 3 ) but once completed and integrated upstream it allows to get great results, like better source code, possible out-of-the-box support, better performance, better compatibility (for example relating to architectures with upstream is possible support any instead only X86 ones of the actual external module), more possibilities about contributions and testing, etc...

Patches submitted

Initial patch was posted at 13 June 2022.

Thanks to many replies, mainly by Christoph Hellwig and Randy Dunlap but not only, many improvements have been made.

A "v1" patch was posted at 2 November 2022.

Other improvements was done and a documentation was added as pointed out by answers outside of the patch posted the integrated documentation is very important and the comments included in the code were not enough.

Thanks to Fabio Fantoni for his for his participation in the "blksnap" project on github and Jonathan Corbet for his article.

A "v2" patch on patchwork or lore was posted at 9 December 2022.

Is also possible use this branch of a linux fork git.

Since then, in collaboration with Christoph, work was carried out to optimize COW algorithms for snapshots, the algorithm for reading images of snapshots, and the control interface was redesigned.

A "v3" patch on patchwork or lore was posted at 4 April 2023.

Thanks for preparing v4 patch:

  • Christoph Hellwig for his significant contribution to the project.
  • Fabio Fantoni for his participation in the project, useful advice and faith in the success of the project.
  • Donald Buczek for researching the module and user-space tool. His fresh look revealed a number of flaw.
  • Bagas Sanjaya for comments on the documentation.

A "v4" patch (cover - patches) was posted at 9 June 2023.

A "v5" patch done immediately afterwards and which contains the majority of response emails, is only a rebase on latest linux-block, was posted at 12 June 2023.

In the v6, the method of saving snapshot difference has been changed. Why this should have been done, Dave Chinner described in detail in the comments to the previous version.

A "v6" patch on lore or patchwork was posted at 7 December 2023.

Thanks to Christoph Hellwig attention to the project, it was possible to raise the quality of the code.

A "v7" patch on lore or patchwork was posted at 9 February 2024.

A patch for LK v6.15 has been prepared. A patch has not yet been proposed for upstream.

Work in progress and news

There is a work in progress for "v8", is possible view/test it using the most updated blksnap-* branch from this fork of the linux git.

For testing this version, the blksnap branch master must be used updated with the latest commits, to have library, tools and tests working with new upstream version.

Latest news are also visible from here

Documentation

When blksnap will be integrated upstream the documentation will be available in https://docs.kernel.org/

For now can be manually generated from kernel source (that include the latest blksnap patch) with make htmldocs and after will be visible opening in browser:

Documentation/output/block/blksnap.html

Documentation/output/block/blkfilter.html

Build

For example an easy and fast way for build kernel and its packages for Debian and derivates is:

# install prerequisites
sudo apt install wget build-essential bison flex libncurses-dev libssl-dev libelf-dev dwarves

take the actual kernel config as base, you can also take another kernel config, should be copied as .config inside the kernel source folder

cp /boot/config-`uname -r` .config

adapt the config to latest kernel version, this will ask for any new options (remember to enable blksnap)

make oldconfig

or you can instead automatically set default for all new options

make olddefconfig
# and after enable blksnap from menu in "Device drivers"->"Block devices"
make menuconfig

build it and make deb packages for easy/fast install/remove it

make deb-pkg

install the generated packages (value inside < > need to be replaced)

sudo dpkg -i linux-image-<version>_<arch>.deb

for debug is needed also "linux-image-" with "-dbg", others can be installed if/when needed

Notes:

  • It can take hour(s) to compile a kernel. Be patient.

  • Need also a big free space on disk, at least 50 gb of free space is recommended.

Contributing

Any contribution is appreciated and useful, is possible contribute in many ways, not only by reviewing patches and contributing with code improvements and fixes, but also with documentation, testing and report, etc... See also CONTRIBUTING