From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by kanga.kvack.org (Postfix) with ESMTP id 23AA36B007B for ; Thu, 28 May 2015 23:41:20 -0400 (EDT) Received: by paza2 with SMTP id a2so39766091paz.3 for ; Thu, 28 May 2015 20:41:19 -0700 (PDT) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com. [2607:f8b0:400e:c03::231]) by mx.google.com with ESMTPS id z5si6453584pdo.233.2015.05.28.20.41.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 20:41:19 -0700 (PDT) Received: by pabru16 with SMTP id ru16so39656968pab.1 for ; Thu, 28 May 2015 20:41:19 -0700 (PDT) Date: Fri, 29 May 2015 12:41:41 +0900 From: Sergey Senozhatsky Subject: Re: [PATCH] zram: clear disk io accounting when reset zram device Message-ID: <20150529034141.GA1157@swordfish> References: <"000001d099be$fae6cc90$f0b465b0$@yang"@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <"000001d099be$fae6cc90$f0b465b0$@yang"@samsung.com> Sender: owner-linux-mm@kvack.org List-ID: To: Weijie Yang Cc: 'Minchan Kim' , 'Andrew Morton' , sergey.senozhatsky.work@gmail.com, ngupta@vflare.org, 'Weijie Yang' , linux-kernel@vger.kernel.org, linux-mm@kvack.org On (05/29/15 11:23), Weijie Yang wrote: > This patch clears zram disk io accounting when reset the zram device, > if don't do this, the residual io accounting stat will affect the > diskstat in the next zram active cycle. > thanks. my bad. Acked-by: Sergey Senozhatsky -ss > Signed-off-by: Weijie Yang > --- > drivers/block/zram/zram_drv.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c > index 8dcbced..6e134f4 100644 > --- a/drivers/block/zram/zram_drv.c > +++ b/drivers/block/zram/zram_drv.c > @@ -805,7 +805,9 @@ static void zram_reset_device(struct zram *zram) > memset(&zram->stats, 0, sizeof(zram->stats)); > zram->disksize = 0; > zram->max_comp_streams = 1; > + > set_capacity(zram->disk, 0); > + part_stat_set_all(&zram->disk->part0, 0); > > up_write(&zram->init_lock); > /* I/O operation under all of CPU are done so let's free */ > -- > 1.7.10.4 > > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org