09 Sep, 2017

1 commit

  • Add zstd compression and decompression support to SquashFS. zstd is a
    great fit for SquashFS because it can compress at ratios approaching xz,
    while decompressing twice as fast as zlib. For SquashFS in particular,
    it can decompress as fast as lzo and lz4. It also has the flexibility
    to turn down the compression ratio for faster compression times.

    The compression benchmark is run on the file tree from the SquashFS archive
    found in ubuntu-16.10-desktop-amd64.iso [1]. It uses `mksquashfs` with the
    default block size (128 KB) and and various compression algorithms/levels.
    xz and zstd are also benchmarked with 256 KB blocks. The decompression
    benchmark times how long it takes to `tar` the file tree into `/dev/null`.
    See the benchmark file in the upstream zstd source repository located under
    `contrib/linux-kernel/squashfs-benchmark.sh` [2] for details.

    I ran the benchmarks on a Ubuntu 14.04 VM with 2 cores and 4 GiB of RAM.
    The VM is running on a MacBook Pro with a 3.1 GHz Intel Core i7 processor,
    16 GB of RAM, and a SSD.

    | Method | Ratio | Compression MB/s | Decompression MB/s |
    |----------------|-------|------------------|--------------------|
    | gzip | 2.92 | 15 | 128 |
    | lzo | 2.64 | 9.5 | 217 |
    | lz4 | 2.12 | 94 | 218 |
    | xz | 3.43 | 5.5 | 35 |
    | xz 256 KB | 3.53 | 5.4 | 40 |
    | zstd 1 | 2.71 | 96 | 210 |
    | zstd 5 | 2.93 | 69 | 198 |
    | zstd 10 | 3.01 | 41 | 225 |
    | zstd 15 | 3.13 | 11.4 | 224 |
    | zstd 16 256 KB | 3.24 | 8.1 | 210 |

    This patch was written by Sean Purcell , but I will be
    taking over the submission process.

    [1] http://releases.ubuntu.com/16.10/
    [2] https://github.com/facebook/zstd/blob/dev/contrib/linux-kernel/squashfs-benchmark.sh

    zstd source repository: https://github.com/facebook/zstd

    Signed-off-by: Sean Purcell
    Signed-off-by: Nick Terrell
    Signed-off-by: Chris Mason
    Acked-by: Phillip Lougher

    Sean Purcell
     

28 Nov, 2014

1 commit


20 Nov, 2013

2 commits

  • Further generalise the decompressors by adding a page handler
    abstraction. This adds helpers to allow the decompressors
    to access and process the output buffers in an implementation
    independant manner.

    This allows different types of output buffer to be passed
    to the decompressors, with the implementation specific
    aspects handled at decompression time, but without the
    knowledge being held in the decompressor wrapper code.

    This will allow the decompressors to handle Squashfs
    cache buffers, and page cache pages.

    This patch adds the abstraction and an implementation for
    the caches.

    Signed-off-by: Phillip Lougher
    Reviewed-by: Minchan Kim

    Phillip Lougher
     
  • The decompressor interface and code was written from
    the point of view of single-threaded operation. In doing
    so it mixed a lot of single-threaded implementation specific
    aspects into the decompressor code and elsewhere which makes it
    difficult to seamlessly support multiple different decompressor
    implementations.

    This patch does the following:

    1. It removes compressor_options parsing from the decompressor
    init() function. This allows the decompressor init() function
    to be dynamically called to instantiate multiple decompressors,
    without the compressor options needing to be read and parsed each
    time.

    2. It moves threading and all sleeping operations out of the
    decompressors. In doing so, it makes the decompressors
    non-blocking wrappers which only deal with interfacing with
    the decompressor implementation.

    3. It splits decompressor.[ch] into decompressor generic functions
    in decompressor.[ch], and moves the single threaded
    decompressor implementation into decompressor_single.c.

    The result of this patch is Squashfs should now be able to
    support multiple decompressors by adding new decompressor_xxx.c
    files with specialised implementations of the functions in
    decompressor_single.c

    Signed-off-by: Phillip Lougher
    Reviewed-by: Minchan Kim

    Phillip Lougher
     

22 Jul, 2011

1 commit

  • Squashfs now supports XZ and LZO compression in addition to ZLIB.
    As such it no longer makes sense to always include ZLIB support.
    In particular embedded systems may only use LZO or XZ compression, and
    the ability to exclude ZLIB support will reduce kernel size.

    Signed-off-by: Phillip Lougher

    Phillip Lougher
     

26 May, 2011

1 commit


01 Mar, 2011

1 commit

  • Extend decompressor framework to handle compression options stored in
    the filesystem. These options can be used by the relevant decompressor
    at initialisation time to over-ride defaults.

    The presence of compression options in the filesystem is indicated by
    the COMP_OPT filesystem flag. If present the data is read from the
    filesystem and passed to the decompressor init function. The decompressor
    init function signature has been extended to take this data.

    Also update the init function signature in the glib, lzo and xz
    decompressor wrappers.

    Signed-off-by: Phillip Lougher

    Phillip Lougher
     

14 Jan, 2011

2 commits


21 Jan, 2010

1 commit