1. 29 Jul, 2018 27 commits
  2. 28 Jul, 2018 6 commits
  3. 27 Jul, 2018 7 commits
    • Gao Xiang's avatar
      staging: erofs: add a TODO and update MAINTAINERS for staging · 27cce7bc
      Gao Xiang authored
      This patch adds a TODO to list the things to be done, and
      the relevant info to MAINTAINERS so we can take all the blame :)
      Signed-off-by: default avatarGao Xiang <gaoxiang25@huawei.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      27cce7bc
    • Gao Xiang's avatar
      staging: erofs: introduce cached decompression · 105d4ad8
      Gao Xiang authored
      This patch adds an optional choice which can be
      enabled by users in order to cache both incomplete
      ends of compressed clusters as a complement to
      the in-place decompression in order to boost random
      read, but it costs more memory than the in-place
      decompression only.
      Signed-off-by: default avatarGao Xiang <gaoxiang25@huawei.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      105d4ad8
    • Gao Xiang's avatar
      staging: erofs: introduce VLE decompression support · 3883a79a
      Gao Xiang authored
      This patch introduces the basic in-place VLE decompression
      implementation for the erofs file system.
      
      Compared with fixed-sized input compression, it implements
      what we call 'the variable-length extent compression' which
      specifies the same output size for each compression block
      to make the full use of IO bandwidth (which means almost
      all data from block device can be directly used for decomp-
      ression), improve the real (rather than just via data caching,
      which costs more memory) random read and keep the relatively
      lower compression ratios (it saves more storage space than
      fixed-sized input compression which is also configured with
      the same input block size), as illustrated below:
      
              |---  variable-length extent ---|------ VLE ------|---  VLE ---|
               /> clusterofs                  /> clusterofs     /> clusterofs /> clusterofs
         ++---|-------++-----------++---------|-++-----------++-|---------++-|
      ...||   |       ||           ||         | ||           || |         || | ... original data
         ++---|-------++-----------++---------|-++-----------++-|---------++-|
         ++->cluster<-++->cluster<-++->cluster<-++->cluster<-++->cluster<-++
              size         size         size         size         size
               \                             /                 /            /
                \                      /              /            /
                 \               /            /            /
                  ++-----------++-----------++-----------++
              ... ||           ||           ||           || ... compressed clusters
                  ++-----------++-----------++-----------++
                  ++->cluster<-++->cluster<-++->cluster<-++
                       size         size         size
      
      The main point of 'in-place' refers to the decompression mode:
      Instead of allocating independent compressed pages and data
      structures, it reuses the allocated file cache pages at most
      to store its compressed data and the corresponding pagevec in
      a time-sharing approach by default, which will be useful for
      low memory scenario.
      
      In the end, unlike the other filesystems with (de)compression
      support using a relatively large compression block size, which
      reads and decompresses >= 128KB at once, and gains a more
      good-looking random read (In fact it collects small random reads
      into large sequential reads and caches all decompressed data
      in memory, but it is unacceptable especially for embedded devices
      with limited memory, and it is not the real random read), we
      select a universal small-sized 4KB compressed cluster, which is
      the smallest page size for most architectures, and all compressed
      clusters can be read and decompressed independently, which ensures
      random read number for all use cases.
      Signed-off-by: default avatarGao Xiang <gaoxiang25@huawei.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3883a79a
    • Gao Xiang's avatar
      staging: erofs: introduce workstation for decompression · e7e9a307
      Gao Xiang authored
      This patch introduces another concept used by the unzip
      subsystem called 'workstation'. It can be seen as a sparse
      array that stores pointers pointed to data structures
      related to the corresponding physical blocks.
      
      All lookup cases are protected by RCU read lock. Besides,
      reference count and spin_lock are also introduced to
      manage its lifetime and serialize all update operations.
      
      'workstation' is currently implemented on the in-kernel
      radix tree approach for backward compatibility.
      With the evolution of linux kernel, it could be migrated
      into XArray implementation in the future.
      Signed-off-by: default avatarGao Xiang <gaoxiang25@huawei.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e7e9a307
    • Gao Xiang's avatar
      staging: erofs: introduce erofs shrinker · a1581312
      Gao Xiang authored
      This patch adds a dedicated shrinker targeting to free unneeded
      memory consumed by a number of erofs in-memory data structures.
      
      Like F2FS and UBIFS, it also adds:
        - sbi->umount_mutex to avoid races on shrinker and put_super
        - sbi->shrinker_run_no to not revisit recently scaned objects
      Signed-off-by: default avatarGao Xiang <gaoxiang25@huawei.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a1581312
    • Gao Xiang's avatar
      staging: erofs: introduce superblock registration · 2497ee41
      Gao Xiang authored
      In order to introducing shrinker solution for erofs,
      let's manage all mounted erofs instances at first.
      Signed-off-by: default avatarGao Xiang <gaoxiang25@huawei.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2497ee41
    • Gao Xiang's avatar
      staging: erofs: add a generic z_erofs VLE decompressor · 0d40d6e3
      Gao Xiang authored
      Currently, this patch only simply implements LZ4
      decompressor due to its development priority.
      
      In the future, erofs will support more compression
      algorithm and format other than LZ4, thus a generic
      decompressor interface will be needed.
      Signed-off-by: default avatarGao Xiang <gaoxiang25@huawei.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0d40d6e3