From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752334AbdHNIIJ (ORCPT ); Mon, 14 Aug 2017 04:08:09 -0400 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:51610 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752064AbdHNIIH (ORCPT ); Mon, 14 Aug 2017 04:08:07 -0400 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.220.163 X-Original-MAILFROM: minchan@kernel.org Date: Mon, 14 Aug 2017 17:08:05 +0900 From: Minchan Kim To: Yisheng Xie Cc: akpm@linux-foundation.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] zram: fix compr_data_size stat Message-ID: <20170814080805.GB26913@bbox> References: <1502413832-13560-1-git-send-email-xieyisheng1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1502413832-13560-1-git-send-email-xieyisheng1@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yisheng, Thanks for the all fixup! A minor nitpick below: On Fri, Aug 11, 2017 at 09:10:32AM +0800, Yisheng Xie wrote: > The compr_data_size is a stat for compressed size of pages stored, which > should add comp_len when we compresse a page. > > Meanwhile fix typos in comment: > * ZRAM_SAME means page consists the same element not the entirely zero page > * read_from_bdev_async() return 1 to avoid call page_endio() in zram_rw_page() > > Signed-off-by: Yisheng Xie > --- > drivers/block/zram/zram_drv.c | 3 ++- > drivers/block/zram/zram_drv.h | 2 +- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c > index e27daca..b2b75b1 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) > @@ -1073,6 +1073,7 @@ static int __zram_bvec_write(struct zram *zram, struct bio_vec *bvec, > } else { > zram_set_handle(zram, index, handle); > zram_set_obj_size(zram, index, comp_len); > + atomic64_add(comp_len, &zram->stats.compr_data_size); I want to add the accounting line to zs_unmap_object. Otherwise, looks good to me. Thanks!