Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1410257 > unrolled thread
| Started by | Sergey Senozhatsky <sergey.senozhatsky@gmail.com> |
|---|---|
| First post | 2016-05-31 14:30 +0200 |
| Last post | 2016-06-01 02:10 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v2 0/8] zram: switch to crypto api Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-05-31 14:30 +0200
[PATCH v2 5/8] zram: cosmetic: cleanup documentation Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-05-31 14:30 +0200
Re: [PATCH v2 5/8] zram: cosmetic: cleanup documentation Minchan Kim <minchan@kernel.org> - 2016-06-01 02:10 +0200
| From | Sergey Senozhatsky <sergey.senozhatsky@gmail.com> |
|---|---|
| Date | 2016-05-31 14:30 +0200 |
| Subject | [PATCH v2 0/8] zram: switch to crypto api |
| Message-ID | <rEQY1-2DM-3@gated-at.bofh.it> |
Hello, This has started as a 'add zlib support' work, but after some thinking I saw no blockers for a bigger change -- a switch to crypto API. We don't have an idle zstreams list anymore and our write path now works absolutely differently, preventing preemption during compression. This removes possibilities of read paths preempting writes at wrong places and opens the door for a move from custom LZO/LZ4 compression backends implementation to a more generic one, using crypto compress API. This patch set also eliminates the need of a new context-less crypto API interface, which was quite hard to sell, so we can move along faster. v2: -- addressed Minchan's review points -- allow out-of-tree comp algorithms, per Minchan -- some other cleanups, reworks and improvements Sergey Senozhatsky (8): zram: rename zstrm find-release functions zram: switch to crypto compress API zram: align zcomp interface to crypto comp API zram: use crypto api to check alg availability zram: cosmetic: cleanup documentation zram: delete custom lzo/lz4 zram: add more compression algorithms zram: drop gfp_t from zcomp_strm_alloc() Documentation/blockdev/zram.txt | 82 +++++++++++++---------- drivers/block/zram/Kconfig | 15 +---- drivers/block/zram/Makefile | 4 +- drivers/block/zram/zcomp.c | 143 ++++++++++++++++++++++++---------------- drivers/block/zram/zcomp.h | 36 +++------- drivers/block/zram/zcomp_lz4.c | 56 ---------------- drivers/block/zram/zcomp_lz4.h | 17 ----- drivers/block/zram/zcomp_lzo.c | 56 ---------------- drivers/block/zram/zcomp_lzo.h | 17 ----- drivers/block/zram/zram_drv.c | 42 +++++++----- drivers/block/zram/zram_drv.h | 5 +- 11 files changed, 171 insertions(+), 302 deletions(-) delete mode 100644 drivers/block/zram/zcomp_lz4.c delete mode 100644 drivers/block/zram/zcomp_lz4.h delete mode 100644 drivers/block/zram/zcomp_lzo.c delete mode 100644 drivers/block/zram/zcomp_lzo.h -- 2.8.3.394.g3916adf
[toc] | [next] | [standalone]
| From | Sergey Senozhatsky <sergey.senozhatsky@gmail.com> |
|---|---|
| Date | 2016-05-31 14:30 +0200 |
| Subject | [PATCH v2 5/8] zram: cosmetic: cleanup documentation |
| Message-ID | <rEQY3-2DM-43@gated-at.bofh.it> |
| In reply to | #1410257 |
zram documentation is a mix of different styles: spaces, tabs, tabs + spaces, etc. clean it up. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Jonathan Corbet <corbet@lwn.net> --- Documentation/blockdev/zram.txt | 91 ++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/Documentation/blockdev/zram.txt b/Documentation/blockdev/zram.txt index 7c05357..0535ae1 100644 --- a/Documentation/blockdev/zram.txt +++ b/Documentation/blockdev/zram.txt @@ -59,23 +59,23 @@ num_devices parameter is optional and tells zram how many devices should be pre-created. Default: 1. 2) Set max number of compression streams - Regardless the value passed to this attribute, ZRAM will always - allocate multiple compression streams - one per online CPUs - thus - allowing several concurrent compression operations. The number of - allocated compression streams goes down when some of the CPUs - become offline. There is no single-compression-stream mode anymore, - unless you are running a UP system or has only 1 CPU online. - - To find out how many streams are currently available: +Regardless the value passed to this attribute, ZRAM will always +allocate multiple compression streams - one per online CPUs - thus +allowing several concurrent compression operations. The number of +allocated compression streams goes down when some of the CPUs +become offline. There is no single-compression-stream mode anymore, +unless you are running a UP system or has only 1 CPU online. + +To find out how many streams are currently available: cat /sys/block/zram0/max_comp_streams 3) Select compression algorithm - Using comp_algorithm device attribute one can see available and - currently selected (shown in square brackets) compression algorithms, - change selected compression algorithm (once the device is initialised - there is no way to change compression algorithm). +Using comp_algorithm device attribute one can see available and +currently selected (shown in square brackets) compression algorithms, +change selected compression algorithm (once the device is initialised +there is no way to change compression algorithm). - Examples: +Examples: #show supported compression algorithms cat /sys/block/zram0/comp_algorithm lzo [lz4] @@ -83,28 +83,27 @@ pre-created. Default: 1. #select lzo compression algorithm echo lzo > /sys/block/zram0/comp_algorithm - For the time being, the `comp_algorithm' content does not necessarily - show every compression algorithm supported by the kernel. We keep this - list primarily to simplify device configuration and one can configure - a new device with a compression algorithm that is not listed in - `comp_algorithm'. The thing is that, internally, ZRAM uses Crypto API - and, if some of the algorithms were built as modules, it's impossible - to list all of them using, for instance, /proc/crypto or any other - method. This, however, has an advantage of permitting the usage of - custom crypto compression modules (implementing S/W or H/W - compression). +For the time being, the `comp_algorithm' content does not necessarily +show every compression algorithm supported by the kernel. We keep this +list primarily to simplify device configuration and one can configure +a new device with a compression algorithm that is not listed in +`comp_algorithm'. The thing is that, internally, ZRAM uses Crypto API +and, if some of the algorithms were built as modules, it's impossible +to list all of them using, for instance, /proc/crypto or any other +method. This, however, has an advantage of permitting the usage of +custom crypto compression modules (implementing S/W or H/W compression). 4) Set Disksize - Set disk size by writing the value to sysfs node 'disksize'. - The value can be either in bytes or you can use mem suffixes. - Examples: - # Initialize /dev/zram0 with 50MB disksize - echo $((50*1024*1024)) > /sys/block/zram0/disksize +Set disk size by writing the value to sysfs node 'disksize'. +The value can be either in bytes or you can use mem suffixes. +Examples: + # Initialize /dev/zram0 with 50MB disksize + echo $((50*1024*1024)) > /sys/block/zram0/disksize - # Using mem suffixes - echo 256K > /sys/block/zram0/disksize - echo 512M > /sys/block/zram0/disksize - echo 1G > /sys/block/zram0/disksize + # Using mem suffixes + echo 256K > /sys/block/zram0/disksize + echo 512M > /sys/block/zram0/disksize + echo 1G > /sys/block/zram0/disksize Note: There is little point creating a zram of greater than twice the size of memory @@ -112,20 +111,20 @@ since we expect a 2:1 compression ratio. Note that zram uses about 0.1% of the size of the disk when not in use so a huge zram is wasteful. 5) Set memory limit: Optional - Set memory limit by writing the value to sysfs node 'mem_limit'. - The value can be either in bytes or you can use mem suffixes. - In addition, you could change the value in runtime. - Examples: - # limit /dev/zram0 with 50MB memory - echo $((50*1024*1024)) > /sys/block/zram0/mem_limit - - # Using mem suffixes - echo 256K > /sys/block/zram0/mem_limit - echo 512M > /sys/block/zram0/mem_limit - echo 1G > /sys/block/zram0/mem_limit - - # To disable memory limit - echo 0 > /sys/block/zram0/mem_limit +Set memory limit by writing the value to sysfs node 'mem_limit'. +The value can be either in bytes or you can use mem suffixes. +In addition, you could change the value in runtime. +Examples: + # limit /dev/zram0 with 50MB memory + echo $((50*1024*1024)) > /sys/block/zram0/mem_limit + + # Using mem suffixes + echo 256K > /sys/block/zram0/mem_limit + echo 512M > /sys/block/zram0/mem_limit + echo 1G > /sys/block/zram0/mem_limit + + # To disable memory limit + echo 0 > /sys/block/zram0/mem_limit 6) Activate: mkswap /dev/zram0 -- 2.8.3.394.g3916adf
[toc] | [prev] | [next] | [standalone]
| From | Minchan Kim <minchan@kernel.org> |
|---|---|
| Date | 2016-06-01 02:10 +0200 |
| Subject | Re: [PATCH v2 5/8] zram: cosmetic: cleanup documentation |
| Message-ID | <rF1Tr-12q-17@gated-at.bofh.it> |
| In reply to | #1410260 |
On Tue, May 31, 2016 at 09:20:14PM +0900, Sergey Senozhatsky wrote: > zram documentation is a mix of different > styles: spaces, tabs, tabs + spaces, etc. > > clean it up. > > Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> > Cc: Minchan Kim <minchan@kernel.org> > Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> > Cc: Jonathan Corbet <corbet@lwn.net> Acked-by: Minchan Kim <minchan@kernel.org>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web