public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next 1/2] zram: fix compr_data_size stat
@ 2017-08-14 10:44 Yisheng Xie
  2017-08-14 10:44 ` [PATCH -next 2/2] zram: fix typo in comment Yisheng Xie
  2017-08-16  1:55 ` [PATCH -next 1/2] zram: fix compr_data_size stat Minchan Kim
  0 siblings, 2 replies; 4+ messages in thread
From: Yisheng Xie @ 2017-08-14 10:44 UTC (permalink / raw)
  To: akpm; +Cc: minchan, ngupta, sergey.senozhatsky.work, linux-kernel

The compr_data_size is a stat for compressed size of pages stored, which
should be updated when we compresse a page.

Meanwhile fix a typo in comment:
* read_from_bdev_async() return 1 to avoid call page_endio() in zram_rw_page()

Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
---
Hi Minchan,
It this ok for you to fold it?

Thanks
Yisheng Xie

 drivers/block/zram/zram_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index e27daca..d18b4ce 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -455,7 +455,7 @@ void zram_page_end_io(struct bio *bio)
 }
 
 /*
- * Returns 0 if the submission is successful.
+ * Returns 1 if the submission is successful.
  */
 static int read_from_bdev_async(struct zram *zram, struct bio_vec *bvec,
 			unsigned long entry, struct bio *parent)
@@ -1059,6 +1059,7 @@ static int __zram_bvec_write(struct zram *zram, struct bio_vec *bvec,
 
 	zcomp_stream_put(zram->comp);
 	zs_unmap_object(zram->mem_pool, handle);
+	atomic64_add(comp_len, &zram->stats.compr_data_size);
 out:
 	/*
 	 * Free memory associated with this sector
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-16  1:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-14 10:44 [PATCH -next 1/2] zram: fix compr_data_size stat Yisheng Xie
2017-08-14 10:44 ` [PATCH -next 2/2] zram: fix typo in comment Yisheng Xie
2017-08-16  1:55   ` Minchan Kim
2017-08-16  1:55 ` [PATCH -next 1/2] zram: fix compr_data_size stat Minchan Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox