Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

zram: cosmetic: cleanup documentation

zram documentation is a mix of different styles: spaces, tabs, tabs +
spaces, etc. Clean it up.

Link: http://lkml.kernel.org/r/20160531122017.2878-6-sergey.senozhatsky@gmail.com
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Sergey Senozhatsky and committed by
Linus Torvalds
69a30a8d 415403be

+42 -43
+42 -43
Documentation/blockdev/zram.txt
··· 59 59 pre-created. Default: 1. 60 60 61 61 2) Set max number of compression streams 62 - Regardless the value passed to this attribute, ZRAM will always 63 - allocate multiple compression streams - one per online CPUs - thus 64 - allowing several concurrent compression operations. The number of 65 - allocated compression streams goes down when some of the CPUs 66 - become offline. There is no single-compression-stream mode anymore, 67 - unless you are running a UP system or has only 1 CPU online. 62 + Regardless the value passed to this attribute, ZRAM will always 63 + allocate multiple compression streams - one per online CPUs - thus 64 + allowing several concurrent compression operations. The number of 65 + allocated compression streams goes down when some of the CPUs 66 + become offline. There is no single-compression-stream mode anymore, 67 + unless you are running a UP system or has only 1 CPU online. 68 68 69 - To find out how many streams are currently available: 69 + To find out how many streams are currently available: 70 70 cat /sys/block/zram0/max_comp_streams 71 71 72 72 3) Select compression algorithm 73 - Using comp_algorithm device attribute one can see available and 74 - currently selected (shown in square brackets) compression algorithms, 75 - change selected compression algorithm (once the device is initialised 76 - there is no way to change compression algorithm). 73 + Using comp_algorithm device attribute one can see available and 74 + currently selected (shown in square brackets) compression algorithms, 75 + change selected compression algorithm (once the device is initialised 76 + there is no way to change compression algorithm). 77 77 78 - Examples: 78 + Examples: 79 79 #show supported compression algorithms 80 80 cat /sys/block/zram0/comp_algorithm 81 81 lzo [lz4] ··· 83 83 #select lzo compression algorithm 84 84 echo lzo > /sys/block/zram0/comp_algorithm 85 85 86 - For the time being, the `comp_algorithm' content does not necessarily 87 - show every compression algorithm supported by the kernel. We keep this 88 - list primarily to simplify device configuration and one can configure 89 - a new device with a compression algorithm that is not listed in 90 - `comp_algorithm'. The thing is that, internally, ZRAM uses Crypto API 91 - and, if some of the algorithms were built as modules, it's impossible 92 - to list all of them using, for instance, /proc/crypto or any other 93 - method. This, however, has an advantage of permitting the usage of 94 - custom crypto compression modules (implementing S/W or H/W 95 - compression). 86 + For the time being, the `comp_algorithm' content does not necessarily 87 + show every compression algorithm supported by the kernel. We keep this 88 + list primarily to simplify device configuration and one can configure 89 + a new device with a compression algorithm that is not listed in 90 + `comp_algorithm'. The thing is that, internally, ZRAM uses Crypto API 91 + and, if some of the algorithms were built as modules, it's impossible 92 + to list all of them using, for instance, /proc/crypto or any other 93 + method. This, however, has an advantage of permitting the usage of 94 + custom crypto compression modules (implementing S/W or H/W compression). 96 95 97 96 4) Set Disksize 98 - Set disk size by writing the value to sysfs node 'disksize'. 99 - The value can be either in bytes or you can use mem suffixes. 100 - Examples: 101 - # Initialize /dev/zram0 with 50MB disksize 102 - echo $((50*1024*1024)) > /sys/block/zram0/disksize 97 + Set disk size by writing the value to sysfs node 'disksize'. 98 + The value can be either in bytes or you can use mem suffixes. 99 + Examples: 100 + # Initialize /dev/zram0 with 50MB disksize 101 + echo $((50*1024*1024)) > /sys/block/zram0/disksize 103 102 104 - # Using mem suffixes 105 - echo 256K > /sys/block/zram0/disksize 106 - echo 512M > /sys/block/zram0/disksize 107 - echo 1G > /sys/block/zram0/disksize 103 + # Using mem suffixes 104 + echo 256K > /sys/block/zram0/disksize 105 + echo 512M > /sys/block/zram0/disksize 106 + echo 1G > /sys/block/zram0/disksize 108 107 109 108 Note: 110 109 There is little point creating a zram of greater than twice the size of memory ··· 111 112 size of the disk when not in use so a huge zram is wasteful. 112 113 113 114 5) Set memory limit: Optional 114 - Set memory limit by writing the value to sysfs node 'mem_limit'. 115 - The value can be either in bytes or you can use mem suffixes. 116 - In addition, you could change the value in runtime. 117 - Examples: 118 - # limit /dev/zram0 with 50MB memory 119 - echo $((50*1024*1024)) > /sys/block/zram0/mem_limit 115 + Set memory limit by writing the value to sysfs node 'mem_limit'. 116 + The value can be either in bytes or you can use mem suffixes. 117 + In addition, you could change the value in runtime. 118 + Examples: 119 + # limit /dev/zram0 with 50MB memory 120 + echo $((50*1024*1024)) > /sys/block/zram0/mem_limit 120 121 121 - # Using mem suffixes 122 - echo 256K > /sys/block/zram0/mem_limit 123 - echo 512M > /sys/block/zram0/mem_limit 124 - echo 1G > /sys/block/zram0/mem_limit 122 + # Using mem suffixes 123 + echo 256K > /sys/block/zram0/mem_limit 124 + echo 512M > /sys/block/zram0/mem_limit 125 + echo 1G > /sys/block/zram0/mem_limit 125 126 126 - # To disable memory limit 127 - echo 0 > /sys/block/zram0/mem_limit 127 + # To disable memory limit 128 + echo 0 > /sys/block/zram0/mem_limit 128 129 129 130 6) Activate: 130 131 mkswap /dev/zram0