1. 09 Jul, 2012 1 commit
  2. 11 Jun, 2012 4 commits
  3. 20 Mar, 2012 1 commit
  4. 13 Feb, 2012 1 commit
    • Nitin Gupta's avatar
      staging: zram: Rename module parameter · 5fa5a901
      Nitin Gupta authored
      
      
      zram accepts number of devices to be created
      as a module parameter. This was renamed from
      num_devices to zram_num_devices (without updating
      the documentation!) since num_devices was declared
      as a non-static global variable, polluting the global
      namespace. Now, we declare it as a static variable
      and revert back the name change.
      
      The documentation (zram.txt) already mentions
      num_devices as the module parameter name.
      Signed-off-by: default avatarNitin Gupta <ngupta@vflare.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5fa5a901
  5. 08 Feb, 2012 1 commit
  6. 08 Dec, 2011 1 commit
  7. 12 Sep, 2011 1 commit
  8. 09 Sep, 2011 1 commit
  9. 06 Sep, 2011 2 commits
  10. 23 Aug, 2011 2 commits
  11. 18 Jul, 2011 1 commit
  12. 05 Jul, 2011 4 commits
  13. 18 Feb, 2011 1 commit
  14. 09 Feb, 2011 1 commit
  15. 04 Feb, 2011 3 commits
  16. 25 Jan, 2011 1 commit
  17. 20 Jan, 2011 2 commits
  18. 30 Dec, 2010 1 commit
  19. 09 Nov, 2010 1 commit
  20. 05 Oct, 2010 1 commit
    • Anton Blanchard's avatar
      Staging: zram: work around oops due to startup ordering snafu · 7e24cce3
      Anton Blanchard authored
      
      
      I'm getting an oops when running mkfs on zram:
      
      NIP [d0000000030e0340] .zram_inc_stat+0x58/0x84 [zram]
      [c00000006d58f720] [d0000000030e091c] .zram_make_request+0xa8/0x6a0 [zram]
      [c00000006d58f840] [c00000000035795c] .generic_make_request+0x390/0x434
      [c00000006d58f950] [c000000000357b14] .submit_bio+0x114/0x140
      [c00000006d58fa20] [c000000000361778] .blkdev_issue_discard+0x1ac/0x250
      [c00000006d58fb10] [c000000000361f68] .blkdev_ioctl+0x358/0x7fc
      [c00000006d58fbd0] [c0000000001c1c1c] .block_ioctl+0x6c/0x90
      [c00000006d58fc70] [c0000000001984c4] .do_vfs_ioctl+0x660/0x6d4
      [c00000006d58fd70] [c0000000001985a0] .SyS_ioctl+0x68/0xb0
      
      Since disksize no longer starts as 0 it looks like we can call
      zram_make_request before the device has been initialised. The patch below
      fixes the immediate problem but this would go away if we move the
      initialisation function elsewhere (as suggested in another thread).
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      7e24cce3
  21. 03 Sep, 2010 1 commit
  22. 31 Aug, 2010 2 commits
    • Nitin Gupta's avatar
      Staging: zram: Remove need for explicit device initialization · 484875ad
      Nitin Gupta authored
      
      
      Currently, the user has to explicitly write a positive value to
      initstate sysfs node before the device can be used. This event
      triggers allocation of per-device metadata like memory pool,
      table array and so on.
      
      We do not pre-initialize all zram devices since the 'table' array,
      mapping disk blocks to compressed chunks, takes considerable amount
      of memory (8 bytes per page). So, pre-initializing all devices will
      be quite wasteful if only few or none of the devices are actually
      used.
      
      This explicit device initialization from user is an odd requirement and
      can be easily avoided. We now initialize the device when first write is
      done to the device.
      Signed-off-by: default avatarNitin Gupta <ngupta@vflare.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      484875ad
    • Nitin Gupta's avatar
      Staging: zram: Replace ioctls with sysfs interface · 33863c21
      Nitin Gupta authored
      
      
      Creates per-device sysfs nodes in /sys/block/zram<id>/
      Currently following stats are exported:
       - disksize
       - num_reads
       - num_writes
       - invalid_io
       - zero_pages
       - orig_data_size
       - compr_data_size
       - mem_used_total
      
      By default, disksize is set to 0. So, to start using
      a zram device, fist write a disksize value and then
      initialize device by writing any positive value to
      initstate. For example:
      
              # initialize /dev/zram0 with 50MB disksize
              echo 50*1024*1024 | bc > /sys/block/zram0/disksize
              echo 1 > /sys/block/zram0/initstate
      
      When done using a disk, issue reset to free its memory
      by writing any positive value to reset node:
      
              echo 1 > /sys/block/zram0/reset
      
      This change also obviates the need for 'rzscontrol' utility.
      Signed-off-by: default avatarNitin Gupta <ngupta@vflare.org>
      Acked-by: default avatarPekka Enberg <penberg@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      33863c21
  23. 24 Jun, 2010 1 commit
    • Randy Dunlap's avatar
      Staging: zram: fix build errors, depends on BLOCK · 8946a086
      Randy Dunlap authored
      
      
      Fix 49 zram build errors in one swoop.  Examples:
      
      drivers/staging/zram/zram_drv.c:225: error: dereferencing pointer to incomplete type
      drivers/staging/zram/zram_drv.c:226: error: implicit declaration of function 'bio_for_each_segment'
      drivers/staging/zram/zram_drv.c:226: error: expected ';' before '{' token
      drivers/staging/zram/zram_drv.c:281: error: implicit declaration of function 'bio_endio'
      drivers/staging/zram/zram_drv.c:285: error: implicit declaration of function 'bio_io_error'
      drivers/staging/zram/zram_drv.c:545: error: implicit declaration of function 'set_capacity'
      drivers/staging/zram/zram_drv.c:548: error: implicit declaration of function 'queue_flag_set_unlocked'
      drivers/staging/zram/zram_drv.c:548: error: 'QUEUE_FLAG_NONROT' undeclared (first use in this function)
      drivers/staging/zram/zram_drv.c:548: error: dereferencing pointer to incomplete type
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      8946a086
  24. 18 Jun, 2010 3 commits
    • Nitin Gupta's avatar
      Staging: zram: Rename ramzswap to zram in code · f1e3cfff
      Nitin Gupta authored
      
      
      Automated renames in code:
       - rzs* -> zram*
       - RZS* -> ZRAM*
       - ramzswap* -> zram*
      
      Manual changes:
       - Edited comments/messages mentioning "swap"
      Signed-off-by: default avatarNitin Gupta <ngupta@vflare.org>
      Acked-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      f1e3cfff
    • Nitin Gupta's avatar
      Staging: Rename ramzswap files to zram · 16a4bfb9
      Nitin Gupta authored
      
      
      Related changes:
       - Modify revelant Kconfig and Makefile accordingly.
       - Change include filenames in code.
       - Remove dependency on CONFIG_SWAP in Kconfig as zram usage
      is no longer limited to swap disks.
      Signed-off-by: default avatarNitin Gupta <ngupta@vflare.org>
      Acked-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      16a4bfb9
    • Nitin Gupta's avatar
      Staging: ramzswap: Support generic I/O requests · a1dd52af
      Nitin Gupta authored
      Currently, ramzwap devices (/dev/ramzswapX) can only
      be used as swap disks since it was hard-coded to consider
      only the first request in bio vector.
      
      Now, we iterate over all the segments in an incoming
      bio which allows us to handle all kinds of I/O requests.
      
      ramzswap devices can still handle PAGE_SIZE aligned and
      multiple of PAGE_SIZE sized I/O requests only. To ensure
      that we get always get such requests only, we set following
      request_queue attributes to PAGE_SIZE:
       - physical_block_size
       - logical_block_size
       - io_min
       - io_opt
      
      Note: physical and logical block sizes were already set
      equal to PAGE_SIZE and that seems to be sufficient to get
      PAGE_SIZE aligned I/O.
      
      Since we are no longer limited to handling swap requests
      only, the next few patches rename ramzswap to zram. So,
      the devices will then be called /dev/zram{0, 1, 2, ...}
      
      Usage/Examples:
       1) Use as /tmp storage
       - mkfs.ext4 /dev/zram0
       - mount /dev/zram0 /tmp
      
       2) Use as swap:
       - mkswap /dev/zram0
       - swapon /dev/zram0 -p 10 # give highest priority to zram0
      
      Performance:
      
       - I/O benchamark done with 'dd' command. Details can be
      found here:
      http://code.google.com/p/compcache/wiki/zramperf
      
      
      Summary:
       - Maximum read speed (approx):
         - ram disk: 1200 MB/sec
         - zram disk: 600 MB/sec
       - Maximum write speed (approx):
         - ram disk: 500 MB/sec
         - zram disk: 160 MB/sec
      
      Issues:
      
       - Double caching: We can potentially waste memory by having
      two copies of a page -- one in page cache (uncompress) and
      second in the device memory (compressed). However, during
      reclaim, clean page cache pages are quickly freed, so this
      does not seem to be a big problem.
      
       - Stale data: Not all filesystems support issuing 'discard'
      requests to underlying block devices. So, if such filesystems
      are used over zram devices, we can accumulate lot of stale
      data in memory. Even for filesystems to do support discard
      (example, ext4), we need to see how effective it is.
      
       - Scalability: There is only one (per-device) de/compression
      buffer stats. This can lead to significant contention, especially
      when used for generic (non-swap) purposes.
      Signed-off-by: default avatarNitin Gupta <ngupta@vflare.org>
      Acked-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      a1dd52af
  25. 18 May, 2010 1 commit
  26. 14 May, 2010 1 commit
    • Nitin Gupta's avatar
      Staging: ramzswap: Remove backing swap support · 97a06382
      Nitin Gupta authored
      
      
      Currently, each ramzswap device can be assigned
      a separate 'backing swap' file/partition. The ramzswap
      driver forwards swap I/O requests to this backing swap
      whenever an incompressible page is found.
      
      This feature adds nearly 700 lines of code and it
      also duplicates much of the swapon() functionality
      (for example, finding swap extents and so on). Removing
      this code makes the driver much simpler and should
      help its transition from staging to stable drivers
      area (drivers/block/).
      
      Similar functionality may be implemented if we can
      implement migrating pages across swap devices but the
      details have not yet been worked out.
      
      Support for _partitions_ as backing swap could be
      retained as it requires a few lines of code only.
      This part can be re-introduced later if above swap
      migration method turns out to be infeasible.
      
      More cleanups and code comments will be added soon.
      Signed-off-by: default avatarNitin Gupta <ngupta@vflare.org>
      Acked-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      97a06382