aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/zram
diff options
context:
space:
mode:
authorSergey Senozhatsky <sergey.senozhatsky@gmail.com>2014-04-07 18:38:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 19:36:00 -0400
commite64cd51d2fa87733176246101df871a8ac5c7c20 (patch)
tree45e18d7863479c0c26504499025c115a57779b7c /drivers/block/zram
parent59fc86a4922f1a1c0f69eac758a7e2b2b138aab4 (diff)
zram: move zram size warning to documentation
Move zram warning about disksize and size of memory correlation to zram documentation. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Acked-by: Minchan Kim <minchan@kernel.org> Cc: Jerome Marchand <jmarchan@redhat.com> Cc: Nitin Gupta <ngupta@vflare.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block/zram')
-rw-r--r--drivers/block/zram/zram_drv.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index c06d7fba4237..21aee3edcb25 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -535,23 +535,8 @@ static void zram_reset_device(struct zram *zram, bool reset_capacity)
535 535
536static void zram_init_device(struct zram *zram, struct zram_meta *meta) 536static void zram_init_device(struct zram *zram, struct zram_meta *meta)
537{ 537{
538 if (zram->disksize > 2 * (totalram_pages << PAGE_SHIFT)) {
539 pr_info(
540 "There is little point creating a zram of greater than "
541 "twice the size of memory since we expect a 2:1 compression "
542 "ratio. Note that zram uses about 0.1%% of the size of "
543 "the disk when not in use so a huge zram is "
544 "wasteful.\n"
545 "\tMemory Size: %lu kB\n"
546 "\tSize you selected: %llu kB\n"
547 "Continuing anyway ...\n",
548 (totalram_pages << PAGE_SHIFT) >> 10, zram->disksize >> 10
549 );
550 }
551
552 /* zram devices sort of resembles non-rotational disks */ 538 /* zram devices sort of resembles non-rotational disks */
553 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, zram->disk->queue); 539 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, zram->disk->queue);
554
555 zram->meta = meta; 540 zram->meta = meta;
556 pr_debug("Initialization done!\n"); 541 pr_debug("Initialization done!\n");
557} 542}