From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752746AbcEMBH6 (ORCPT ); Thu, 12 May 2016 21:07:58 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34982 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751387AbcEMBH5 (ORCPT ); Thu, 12 May 2016 21:07:57 -0400 Date: Fri, 13 May 2016 10:09:29 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Sergey Senozhatsky , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Sergey Senozhatsky Subject: Re: [PATCH] zram: introduce per-device debug_stat sysfs node Message-ID: <20160513010929.GA615@swordfish> References: <20160511134553.12655-1-sergey.senozhatsky@gmail.com> <20160512234143.GA27204@bbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160512234143.GA27204@bbox> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Minchan, On (05/13/16 08:41), Minchan Kim wrote: [..] will fix and update, thanks! > > @@ -719,6 +737,8 @@ compress_again: > > zcomp_strm_release(zram->comp, zstrm); > > zstrm = NULL; > > > > + atomic64_inc(&zram->stats.num_recompress); > > + > > It should be below "goto compress_again". I moved it out of goto intentionally. this second zs_malloc() handle = zs_malloc(meta->mem_pool, clen, GFP_NOIO | __GFP_HIGHMEM | __GFP_MOVABLE); can take some time to complete, which will slow down zram for a bit, and _theoretically_ this second zs_malloc() still can fail. yes, we would do the error print out pr_err("Error allocating memory ... ") and inc the `failed_writes' in zram_bvec_rw(), but zram_bvec_write() has several more error return paths that can inc the `failed_writes'. so by just looking at the stats we won't be able to tell that we had failed fast path allocation combined with failed slow path allocation (IOW, `goto recompress' never happened). so I'm thinking about changing its name to num_failed_fast_compress or num_failed_fast_write, or something similar and thus count the number of times we fell to "!handle" branch, not the number of goto-s. what do you think? or do you want it to be num_recompress specifically? > Other than that, > > Acked-by: Minchan Kim > thanks. -ss