07 May, 2021

1 commit

  • Fix ~94 single-word typos in locking code comments, plus a few
    very obvious grammar mistakes.

    Link: https://lkml.kernel.org/r/20210322212624.GA1963421@gmail.com
    Link: https://lore.kernel.org/r/20210322205203.GB1959563@gmail.com
    Signed-off-by: Ingo Molnar
    Reviewed-by: Matthew Wilcox (Oracle)
    Reviewed-by: Randy Dunlap
    Cc: Bhaskar Chowdhury
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     

27 Feb, 2021

1 commit

  • Patch series "Fix the compatibility of zsmalloc and zswap".

    Patch #1 adds a flag to zpool, then zswap used to determine if zpool
    drivers such as zbud/z3fold/zsmalloc will enter an atomic context after
    mapping.

    The difference between zbud/z3fold and zsmalloc is that zsmalloc requires
    an atomic context that since its map function holds a preempt-disabled,
    but zbud/z3fold don't require an atomic context. So patch #2 sets flag
    sleep_mapped to true indicating that zbud/z3fold can sleep after mapping.
    zsmalloc didn't support sleep after mapping, so don't set that flag to
    true.

    This patch (of 2):

    Add a flag to zpool, named is "can_sleep_mapped", and have it set true for
    zbud/z3fold, not set this flag for zsmalloc, so its default value is
    false. Then zswap could go the current path if the flag is true; and if
    it's false, copy data from src to a temporary buffer, then unmap the
    handle, take the mutex, process the buffer instead of src to avoid
    sleeping function called from atomic context.

    [natechancellor@gmail.com: add return value in zswap_frontswap_load]
    Link: https://lkml.kernel.org/r/20210121214804.926843-1-natechancellor@gmail.com
    [tiantao6@hisilicon.com: fix potential memory leak]
    Link: https://lkml.kernel.org/r/1611538365-51811-1-git-send-email-tiantao6@hisilicon.com
    [colin.king@canonical.com: fix potential uninitialized pointer read on tmp]
    Link: https://lkml.kernel.org/r/20210128141728.639030-1-colin.king@canonical.com
    [tiantao6@hisilicon.com: fix variable 'entry' is uninitialized when used]
    Link: https://lkml.kernel.org/r/1611223030-58346-1-git-send-email-tiantao6@hisilicon.comLink: https://lkml.kernel.org/r/1611035683-12732-1-git-send-email-tiantao6@hisilicon.com

    Link: https://lkml.kernel.org/r/1611035683-12732-2-git-send-email-tiantao6@hisilicon.com
    Signed-off-by: Tian Tao
    Signed-off-by: Nathan Chancellor
    Signed-off-by: Colin Ian King
    Reviewed-by: Vitaly Wool
    Acked-by: Sebastian Andrzej Siewior
    Reported-by: Mike Galbraith
    Cc: Barry Song
    Cc: Dan Streetman
    Cc: Seth Jennings
    Cc: Dan Carpenter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tian Tao
     

13 Aug, 2020

1 commit


25 Sep, 2019

1 commit

  • As a zpool_driver, zsmalloc can allocate movable memory because it support
    migate pages. But zbud and z3fold cannot allocate movable memory.

    Add malloc_support_movable to zpool_driver. If a zpool_driver support
    allocate movable memory, set it to true. And add
    zpool_malloc_support_movable check malloc_support_movable to make sure if
    a zpool support allocate movable memory.

    Link: http://lkml.kernel.org/r/20190605100630.13293-1-teawaterz@linux.alibaba.com
    Signed-off-by: Hui Zhu
    Reviewed-by: Shakeel Butt
    Cc: Dan Streetman
    Cc: Minchan Kim
    Cc: Nitin Gupta
    Cc: Sergey Senozhatsky
    Cc: Seth Jennings
    Cc: Vitaly Wool
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hui Zhu
     

21 May, 2019

1 commit

  • Add SPDX license identifiers to all files which:

    - Have no license information of any form

    - Have MODULE_LICENCE("GPL*") inside which was used in the initial
    scan/conversion to ignore the file

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

22 Feb, 2018

1 commit


07 Feb, 2018

2 commits

  • There are several places where parameter descriptions do no match the
    actual code. Fix it.

    Link: http://lkml.kernel.org/r/1516700871-22279-3-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Cc: Jonathan Corbet
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • so that kernel-doc will properly recognize the parameter and function
    descriptions.

    Link: http://lkml.kernel.org/r/1516700871-22279-2-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Cc: Jonathan Corbet
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

01 Feb, 2018

1 commit

  • We waste sizeof(swp_entry_t) for zswap header when using zsmalloc as
    zpool driver because zsmalloc doesn't support eviction.

    Add zpool_evictable() to detect if zpool is potentially evictable, and
    use it in zswap to avoid waste memory for zswap header.

    [yuzhao@google.com: The zpool->" prefix is a result of copy & paste]
    Link: http://lkml.kernel.org/r/20180110225626.110330-1-yuzhao@google.com
    Link: http://lkml.kernel.org/r/20180110224741.83751-1-yuzhao@google.com
    Signed-off-by: Yu Zhao
    Acked-by: Dan Streetman
    Reviewed-by: Sergey Senozhatsky
    Cc: Seth Jennings
    Cc: Minchan Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yu Zhao
     

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