07 Nov, 2015

2 commits

  • Constify `struct zs_pool' ->name.

    [akpm@inux-foundation.org: constify zpool_create_pool()'s `type' arg also]
    Signed-off-by: Sergey Senozhatsky
    Acked-by: Dan Streetman
    Cc: Minchan Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sergey SENOZHATSKY
     
  • Make the return type of zpool_get_type const; the string belongs to the
    zpool driver and should not be modified. Remove the redundant type field
    in the struct zpool; it is private to zpool.c and isn't needed since
    ->driver->type can be used directly. Add comments indicating strings must
    be null-terminated.

    Signed-off-by: Dan Streetman
    Cc: Sergey Senozhatsky
    Cc: Seth Jennings
    Cc: Minchan Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Streetman
     

11 Sep, 2015

1 commit

  • This series makes creation of the zpool and compressor dynamic, so that
    they can be changed at runtime. This makes using/configuring zswap
    easier, as before this zswap had to be configured at boot time, using boot
    params.

    This uses a single list to track both the zpool and compressor together,
    although Seth had mentioned an alternative which is to track the zpools
    and compressors using separate lists. In the most common case, only a
    single zpool and single compressor, using one list is slightly simpler
    than using two lists, and for the uncommon case of multiple zpools and/or
    compressors, using one list is slightly less simple (and uses slightly
    more memory, probably) than using two lists.

    This patch (of 4):

    Add zpool_has_pool() function, indicating if the specified type of zpool
    is available (i.e. zsmalloc or zbud). This allows checking if a pool is
    available, without actually trying to allocate it, similar to
    crypto_has_alg().

    This is used by a following patch to zswap that enables the dynamic
    runtime creation of zswap zpools.

    Signed-off-by: Dan Streetman
    Acked-by: Seth Jennings
    Cc: Sergey Senozhatsky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Streetman
     

09 Sep, 2015

2 commits


26 Jun, 2015

2 commits

  • Remove zpool_evict() helper function. As zbud is currently the only
    zpool implementation that supports eviction, add zpool and zpool_ops
    references to struct zbud_pool and directly call zpool_ops->evict(zpool,
    handle) on eviction.

    Currently zpool provides the zpool_evict helper which locks the zpool
    list lock and searches through all pools to find the specific one
    matching the caller, and call the corresponding zpool_ops->evict
    function. However, this is unnecessary, as the zbud pool can simply
    keep a reference to the zpool that created it, as well as the zpool_ops,
    and directly call the zpool_ops->evict function, when it needs to evict
    a page. This avoids a spinlock and list search in zpool for each
    eviction.

    Signed-off-by: Dan Streetman
    Cc: Seth Jennings
    Cc: Minchan Kim
    Cc: Nitin Gupta
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Streetman
     
  • Change the pr_info() calls to pr_debug(). There's no need for the extra
    verbosity in the log. Also change the msg formats to be consistent.

    Signed-off-by: Dan Streetman
    Cc: Kees Cook
    Cc: Minchan Kim
    Cc: Ganesh Mahendran
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Streetman
     

13 Feb, 2015

1 commit

  • Currently the underlay of zpool: zsmalloc/zbud, do not know who creates
    them. There is not a method to let zsmalloc/zbud find which caller they
    belong to.

    Now we want to add statistics collection in zsmalloc. We need to name the
    debugfs dir for each pool created. The way suggested by Minchan Kim is to
    use a name passed by caller(such as zram) to create the zsmalloc pool.

    /sys/kernel/debug/zsmalloc/zram0

    This patch adds an argument `name' to zs_create_pool() and other related
    functions.

    Signed-off-by: Ganesh Mahendran
    Acked-by: Minchan Kim
    Cc: Seth Jennings
    Cc: Nitin Gupta
    Cc: Dan Streetman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ganesh Mahendran
     

30 Aug, 2014

1 commit

  • To avoid potential format string expansion via module parameters, do not
    use the zpool type directly in request_module() without a format string.
    Additionally, to avoid arbitrary modules being loaded via zpool API
    (e.g. via the zswap_zpool_type module parameter) add a "zpool-" prefix
    to the requested module, as well as module aliases for the existing
    zpool types (zbud and zsmalloc).

    Signed-off-by: Kees Cook
    Cc: Seth Jennings
    Cc: Minchan Kim
    Cc: Nitin Gupta
    Acked-by: Dan Streetman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kees Cook
     

07 Aug, 2014

1 commit

  • Add zpool api.

    zpool provides an interface for memory storage, typically of compressed
    memory. Users can select what backend to use; currently the only
    implementations are zbud, a low density implementation with up to two
    compressed pages per storage page, and zsmalloc, a higher density
    implementation with multiple compressed pages per storage page.

    Signed-off-by: Dan Streetman
    Tested-by: Seth Jennings
    Cc: Minchan Kim
    Cc: Nitin Gupta
    Cc: Weijie Yang
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Streetman