1. 28 Feb, 2017 1 commit
  2. 25 Feb, 2017 1 commit
  3. 23 Feb, 2017 1 commit
  4. 24 Oct, 2016 1 commit
  5. 21 Oct, 2016 1 commit
  6. 26 Jul, 2016 2 commits
  7. 21 May, 2016 2 commits
  8. 14 Mar, 2016 1 commit
  9. 24 Sep, 2015 1 commit
  10. 08 Sep, 2015 1 commit
  11. 26 Jun, 2015 3 commits
    • Sergey Senozhatsky's avatar
      zram: add dynamic device add/remove functionality · 6566d1a3
      Sergey Senozhatsky authored
      We currently don't support on-demand device creation.  The one and only
      way to have N zram devices is to specify num_devices module parameter
      (default value: 1).  IOW if, for some reason, at some point, user wants
      to have N + 1 devies he/she must umount all the existing devices, unload
      the module, load the module passing num_devices equals to N + 1.  And do
      this again, if needed.
      
      This patch introduces zram control sysfs class, which has two sysfs
      attrs:
      - hot_add      -- add a new zram device
      - hot_remove   -- remove a specific (device_id) zram device
      
      hot_add sysfs attr is read-only and has only automatic device id
      assignment mode (as requested by Minchan Kim).  read operation performed
      on this attr creates a new zram device and returns back its device_id or
      error status.
      
      Usage example:
      	# add a new specific zram device
      	cat /sys/class/zram-control/hot_add
      	2
      
      	# remove a specific zram device
      	echo 4 > /sys/class/zram-control/hot_remove
      
      Returning zram_add() error code back to user (-ENOMEM in this case)
      
      	cat /sys/class/zram-control/hot_add
      	cat: /sys/class/zram-control/hot_add: Cannot allocate memory
      
      NOTE, there might be users who already depend on the fact that at least
      zram0 device gets always created by zram_init(). Preserve this behavior.
      
      [minchan@kernel.org: use zram->claim to avoid lockdep splat]
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6566d1a3
    • Sergey Senozhatsky's avatar
      zram: remove max_num_devices limitation · c3cdb40e
      Sergey Senozhatsky authored
      Limiting the number of zram devices to 32 (default max_num_devices value)
      is confusing, let's drop it.  A user with 2TB or 4TB of RAM, for example,
      can request as many devices as he can handle.
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: default avatarMinchan Kim <minchan@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c3cdb40e
    • Sergey Senozhatsky's avatar
      zram: add `compact` sysfs entry to documentation · 3d8ed88b
      Sergey Senozhatsky authored
      We currently don't support zram on-demand device creation.  The only way
      to have N zram devices is to specify num_devices module parameter (default
      value 1).  That means that if, for some reason, at some point, user wants
      to have N + 1 devies he/she must umount all the existing devices, unload
      the module, load the module passing num_devices equals to N + 1.
      
      This patchset introduces zram-control sysfs class, which has two sysfs
      attrs:
      
       - hot_add     -- add a new zram device
       - hot_remove  -- remove a specific (device_id) zram device
      
          Usage example:
              # add a new specific zram device
              cat /sys/class/zram-control/hot_add
              1
      
              # remove a specific zram device
              echo 4 > /sys/class/zram-control/hot_remove
      
      This patch (of 10):
      
      Briefly describe missing `compact` sysfs entry.
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: default avatarMinchan Kim <minchan@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3d8ed88b
  12. 15 Apr, 2015 4 commits
  13. 02 Apr, 2015 2 commits
  14. 10 Oct, 2014 2 commits
    • Minchan Kim's avatar
      zram: report maximum used memory · 461a8eee
      Minchan Kim authored
      Normally, zram user could get maximum memory usage zram consumed via
      polling mem_used_total with sysfs in userspace.
      
      But it has a critical problem because user can miss peak memory usage
      during update inverval of polling.  For avoiding that, user should poll it
      with shorter interval(ie, 0.0000000001s) with mlocking to avoid page fault
      delay when memory pressure is heavy.  It would be troublesome.
      
      This patch adds new knob "mem_used_max" so user could see the maximum
      memory usage easily via reading the knob and reset it via "echo 0 >
      /sys/block/zram0/mem_used_max".
      Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
      Reviewed-by: default avatarDan Streetman <ddstreet@ieee.org>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Cc: <juno.choi@lge.com>
      Cc: <seungho1.park@lge.com>
      Cc: Luigi Semenzato <semenzato@google.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Seth Jennings <sjennings@variantweb.net>
      Reviewed-by: default avatarDavid Horner <ds2horner@gmail.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      461a8eee
    • Minchan Kim's avatar
      zram: zram memory size limitation · 9ada9da9
      Minchan Kim authored
      Since zram has no control feature to limit memory usage, it makes hard to
      manage system memrory.
      
      This patch adds new knob "mem_limit" via sysfs to set up the a limit so
      that zram could fail allocation once it reaches the limit.
      
      In addition, user could change the limit in runtime so that he could
      manage the memory more dynamically.
      
      Initial state is no limit so it doesn't break old behavior.
      
      [akpm@linux-foundation.org: fix typo, per Sergey]
      Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
      Cc: Dan Streetman <ddstreet@ieee.org>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Cc: <juno.choi@lge.com>
      Cc: <seungho1.park@lge.com>
      Cc: Luigi Semenzato <semenzato@google.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Seth Jennings <sjennings@variantweb.net>
      Cc: David Horner <ds2horner@gmail.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9ada9da9
  15. 07 Apr, 2014 5 commits
    • Minchan Kim's avatar
      zram: propagate error to user · 60a726e3
      Minchan Kim authored
      When we initialized zcomp with single, we couldn't change
      max_comp_streams without zram reset but current interface doesn't show
      any error to user and even it changes max_comp_streams's value without
      any effect so it would make user very confusing.
      
      This patch prevents max_comp_streams's change when zcomp was initialized
      as single zcomp and emit the error to user(ex, echo).
      
      [akpm@linux-foundation.org: don't return with the lock held, per Sergey]
      [fengguang.wu@intel.com: fix coccinelle warnings]
      Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Acked-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Signed-off-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      60a726e3
    • Sergey Senozhatsky's avatar
      zram: make compression algorithm selection possible · e46b8a03
      Sergey Senozhatsky authored
      Add and document `comp_algorithm' device attribute.  This attribute allows
      to show supported compression and currently selected compression
      algorithms:
      
      	cat /sys/block/zram0/comp_algorithm
      	[lzo] lz4
      
      and change selected compression algorithm:
      	echo lzo > /sys/block/zram0/comp_algorithm
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: default avatarMinchan Kim <minchan@kernel.org>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e46b8a03
    • Sergey Senozhatsky's avatar
      zram: add multi stream functionality · beca3ec7
      Sergey Senozhatsky authored
      Existing zram (zcomp) implementation has only one compression stream
      (buffer and algorithm private part), so in order to prevent data
      corruption only one write (compress operation) can use this compression
      stream, forcing all concurrent write operations to wait for stream lock
      to be released.  This patch changes zcomp to keep a compression streams
      list of user-defined size (via sysfs device attr).  Each write operation
      still exclusively holds compression stream, the difference is that we
      can have N write operations (depending on size of streams list)
      executing in parallel.  See TEST section later in commit message for
      performance data.
      
      Introduce struct zcomp_strm_multi and a set of functions to manage
      zcomp_strm stream access.  zcomp_strm_multi has a list of idle
      zcomp_strm structs, spinlock to protect idle list and wait queue, making
      it possible to perform parallel compressions.
      
      The following set of functions added:
      - zcomp_strm_multi_find()/zcomp_strm_multi_release()
        find and release a compression stream, implement required locking
      - zcomp_strm_multi_create()/zcomp_strm_multi_destroy()
        create and destroy zcomp_strm_multi
      
      zcomp ->strm_find() and ->strm_release() callbacks are set during
      initialisation to zcomp_strm_multi_find()/zcomp_strm_multi_release()
      correspondingly.
      
      Each time zcomp issues a zcomp_strm_multi_find() call, the following set
      of operations performed:
      
      - spin lock strm_lock
      - if idle list is not empty, remove zcomp_strm from idle list, spin
        unlock and return zcomp stream pointer to caller
      - if idle list is empty, current adds itself to wait queue. it will be
        awaken by zcomp_strm_multi_release() caller.
      
      zcomp_strm_multi_release():
      - spin lock strm_lock
      - add zcomp stream to idle list
      - spin unlock, wake up sleeper
      
      Minchan Kim reported that spinlock-based locking scheme has demonstrated
      a severe perfomance regression for single compression stream case,
      comparing to mutex-based (see https://lkml.org/lkml/2014/2/18/16)
      
      base                      spinlock                    mutex
      
      ==Initial write           ==Initial write             ==Initial  write
      records:  5               records:  5                 records:   5
      avg:      1642424.35      avg:      699610.40         avg:       1655583.71
      std:      39890.95(2.43%) std:      232014.19(33.16%) std:       52293.96
      max:      1690170.94      max:      1163473.45        max:       1697164.75
      min:      1568669.52      min:      573429.88         min:       1553410.23
      ==Rewrite                 ==Rewrite                   ==Rewrite
      records:  5               records:  5                 records:   5
      avg:      1611775.39      avg:      501406.64         avg:       1684419.11
      std:      17144.58(1.06%) std:      15354.41(3.06%)   std:       18367.42
      max:      1641800.95      max:      531356.78         max:       1706445.84
      min:      1593515.27      min:      488817.78         min:       1655335.73
      
      When only one compression stream available, mutex with spin on owner
      tends to perform much better than frequent wait_event()/wake_up().  This
      is why single stream implemented as a special case with mutex locking.
      
      Introduce and document zram device attribute max_comp_streams.  This
      attr shows and stores current zcomp's max number of zcomp streams
      (max_strm).  Extend zcomp's zcomp_create() with `max_strm' parameter.
      `max_strm' limits the number of zcomp_strm structs in compression
      backend's idle list (max_comp_streams).
      
      max_comp_streams used during initialisation as follows:
      -- passing to zcomp_create() max_strm equals to 1 will initialise zcomp
      using single compression stream zcomp_strm_single (mutex-based locking).
      -- passing to zcomp_create() max_strm greater than 1 will initialise zcomp
      using multi compression stream zcomp_strm_multi (spinlock-based locking).
      
      default max_comp_streams value is 1, meaning that zram with single stream
      will be initialised.
      
      Later patch will introduce configuration knob to change max_comp_streams
      on already initialised and used zcomp.
      
      TEST
      iozone -t 3 -R -r 16K -s 60M -I +Z
      
             test           base       1 strm (mutex)     3 strm (spinlock)
      -----------------------------------------------------------------------
       Initial write      589286.78       583518.39          718011.05
             Rewrite      604837.97       596776.38         1515125.72
        Random write      584120.11       595714.58         1388850.25
              Pwrite      535731.17       541117.38          739295.27
              Fwrite     1418083.88      1478612.72         1484927.06
      
      Usage example:
      set max_comp_streams to 4
              echo 4 > /sys/block/zram0/max_comp_streams
      
      show current max_comp_streams (default value is 1).
              cat /sys/block/zram0/max_comp_streams
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: default avatarMinchan Kim <minchan@kernel.org>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      beca3ec7
    • Sergey Senozhatsky's avatar
      zram: document failed_reads, failed_writes stats · 8dd1d324
      Sergey Senozhatsky authored
      Document `failed_reads' and `failed_writes' device attributes.
      Remove info about `discard' - there is no such zram attr.
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8dd1d324
    • Sergey Senozhatsky's avatar
      zram: move zram size warning to documentation · e64cd51d
      Sergey Senozhatsky authored
      Move zram warning about disksize and size of memory correlation to zram
      documentation.
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: default avatarMinchan Kim <minchan@kernel.org>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e64cd51d
  16. 17 Feb, 2014 1 commit
  17. 31 Jan, 2014 2 commits
    • Minchan Kim's avatar
      zram: remove old private project comment · 49061236
      Minchan Kim authored
      Remove the old private compcache project address so upcoming patches
      should be sent to LKML because we Linux kernel community will take care.
      Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      49061236
    • Minchan Kim's avatar
      zram: promote zram from staging · cd67e10a
      Minchan Kim authored
      Zram has lived in staging for a LONG LONG time and have been
      fixed/improved by many contributors so code is clean and stable now.  Of
      course, there are lots of product using zram in real practice.
      
      The major TV companys have used zram as swap since two years ago and
      recently our production team released android smart phone with zram
      which is used as swap, too and recently Android Kitkat start to use zram
      for small memory smart phone.  And there was a report Google released
      their ChromeOS with zram, too and cyanogenmod have been used zram long
      time ago.  And I heard some disto have used zram block device for tmpfs.
      In addition, I saw many report from many other peoples.  For example,
      Lubuntu start to use it.
      
      The benefit of zram is very clear.  With my experience, one of the
      benefit was to remove jitter of video application with backgroud memory
      pressure.  It would be effect of efficient memory usage by compression
      but more issue is whether swap is there or not in the system.  Recent
      mobile platforms have used JAVA so there are many anonymous pages.  But
      embedded system normally are reluctant to use eMMC or SDCard as swap
      because there is wear-leveling and latency issues so if we do not use
      swap, it means we can't reclaim anoymous pages and at last, we could
      encounter OOM kill.  :(
      
      Although we have real storage as swap, it was a problem, too.  Because
      it sometime ends up making system very unresponsible caused by slow swap
      storage performance.
      
      Quote from Luigi on Google
       "Since Chrome OS was mentioned: the main reason why we don't use swap
        to a disk (rotating or SSD) is because it doesn't degrade gracefully
        and leads to a bad interactive experience.  Generally we prefer to
        manage RAM at a higher level, by transparently killing and restarting
        processes.  But we noticed that zram is fast enough to be competitive
        with the latter, and it lets us make more efficient use of the
        available RAM.  " and he announced.
      http://www.spinics.net/lists/linux-mm/msg57717.html
      
      Other uses case is to use zram for block device.  Zram is block device
      so anyone can format the block device and mount on it so some guys on
      the internet start zram as /var/tmp.
      http://forums.gentoo.org/viewtopic-t-838198-start-0.html
      
      Let's promote zram and enhance/maintain it instead of removing.
      Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
      Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Acked-by: default avatarNitin Gupta <ngupta@vflare.org>
      Acked-by: default avatarPekka Enberg <penberg@kernel.org>
      Cc: Bob Liu <bob.liu@oracle.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Luigi Semenzato <semenzato@google.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cd67e10a
  18. 24 Jan, 2014 1 commit
  19. 08 Nov, 2013 1 commit
  20. 28 Feb, 2013 1 commit
    • Wouter Verhelst's avatar
      nbd: update documentation and link to mailinglist · 5e4b269b
      Wouter Verhelst authored
      Documentation/blockdev/nbd.txt contained some documentation which was
      horribly outdated and probably still dates from the original patch that
      added NBD support to the kernel.
      
      This patch removes the useless and outdated bits.  The tools on nbd.sf.net
      are fully documented in manpages, which is where documentation for the
      non-kernel bits should live.
      
      Additionally, add a reference to the MAINTAINERS file for the nbd-general
      mailinglist that is used for discussion of the userland tools and the
      kernel module already.
      Signed-off-by: default avatarWouter Verhelst <w@uter.be>
      Cc: Paul Clements <Paul.Clements@steeleye.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5e4b269b
  21. 30 Mar, 2012 1 commit
  22. 16 Nov, 2011 1 commit
    • Stephen M. Cameron's avatar
      cciss: auto engage SCSI mid layer at driver load time · 0007a4c9
      Stephen M. Cameron authored
      A long time ago, probably in 2002, one of the distros, or maybe more than
      one, loaded block drivers prior to loading the SCSI mid layer.  This meant
      that the cciss driver, being a block driver, could not engage the SCSI mid
      layer at init time without panicking, and relied on being poked by a
      userland program after the system was up (and the SCSI mid layer was
      therefore present) to engage the SCSI mid layer.
      
      This is no longer the case, and cciss can safely rely on the SCSI mid
      layer being present at init time and engage the SCSI mid layer straight
      away.  This means that users will see their tape drives and medium
      changers at driver load time without need for a script in /etc/rc.d that
      does this:
      
      for x in /proc/driver/cciss/cciss*
      do
      	echo "engage scsi" > $x
      done
      
      However, if no tape drives or medium changers are detected, the SCSI mid
      layer will not be engaged.  If a tape drive or medium change is later
      hot-added to the system it will then be necessary to use the above script
      or similar for the device(s) to be acceesible.
      Signed-off-by: default avatarStephen M. Cameron <scameron@beardog.cce.hp.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      0007a4c9
  23. 08 Aug, 2011 1 commit
  24. 13 Jun, 2011 1 commit
  25. 06 May, 2011 1 commit
    • Stephen M. Cameron's avatar
      cciss: add cciss_tape_cmds module paramter · 8a4ec67b
      Stephen M. Cameron authored
      This is to allow number of commands reserved for use by SCSI tape drives
      and medium changers to be adjusted at driver load time via the kernel
      parameter cciss_tape_cmds, with a default value of 6, and a range
      of 2 - 16 inclusive.  Previously, the driver limited the number of
      commands which could be queued to the SCSI half of the the driver
      to only 2.  This is to fix the problem that if you had more than
      two tape drives, you couldn't, for example, erase or rewind them all
      at the same time.
      Signed-off-by: default avatarStephen M. Cameron <scameron@beardog.cce.hp.com>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      8a4ec67b
  26. 04 Aug, 2010 1 commit
    • Justin P. Mattock's avatar
      Documentation: update broken web addresses. · 0ea6e611
      Justin P. Mattock authored
      Below you will find an updated version from the original series bunching all patches into one big patch
      updating broken web addresses that are located in Documentation/*
      Some of the addresses date as far far back as 1995 etc... so searching became a bit difficult,
      the best way to deal with these is to use web.archive.org to locate these addresses that are outdated.
      Now there are also some addresses pointing to .spec files some are located, but some(after searching
      on the companies site)where still no where to be found. In this case I just changed the address
      to the company site this way the users can contact the company and they can locate them for the users.
      Signed-off-by: default avatarJustin P. Mattock <justinmattock@gmail.com>
      Signed-off-by: default avatarThomas Weber <weber@corscience.de>
      Signed-off-by: default avatarMike Frysinger <vapier.adi@gmail.com>
      Cc: Paulo Marques <pmarques@grupopie.com>
      Cc: Randy Dunlap <rdunlap@xenotime.net>
      Cc: Michael Neuling <mikey@neuling.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      0ea6e611