From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753138AbdHNKyG (ORCPT ); Mon, 14 Aug 2017 06:54:06 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3077 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753104AbdHNKyF (ORCPT ); Mon, 14 Aug 2017 06:54:05 -0400 Subject: Re: [PATCH -next] zram: fix compr_data_size stat To: Minchan Kim References: <1502413832-13560-1-git-send-email-xieyisheng1@huawei.com> <20170814080805.GB26913@bbox> <20170814093411.GI26913@bbox> CC: , , , From: Yisheng Xie Message-ID: Date: Mon, 14 Aug 2017 18:53:20 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20170814093411.GI26913@bbox> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.40] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.59918142.00EA,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: e8ac5fd6ce0bdf4039e5c348404b9255 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017/8/14 17:34, Minchan Kim wrote: > On Mon, Aug 14, 2017 at 05:24:16PM +0800, Yisheng Xie wrote: >> Hi, Minchan >> >> Thanks for your comment! >> On 2017/8/14 16:08, Minchan Kim wrote: >>> 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. >> >> Right, this accounting can be done without slot lock! >> >> You will fold this patch? or should I send another version? > > Could you separate same element comment part and others? Of course. > With that, we can apply same element comment correctpart > and fold other parts which fixes writeback feature bugs > to original patches. > > Thanks! > > . >