From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f198.google.com (mail-pf0-f198.google.com [209.85.192.198]) by kanga.kvack.org (Postfix) with ESMTP id 1BE026B007E for ; Fri, 13 May 2016 03:04:22 -0400 (EDT) Received: by mail-pf0-f198.google.com with SMTP id 77so189635211pfz.3 for ; Fri, 13 May 2016 00:04:22 -0700 (PDT) Received: from mail-pa0-x242.google.com (mail-pa0-x242.google.com. [2607:f8b0:400e:c03::242]) by mx.google.com with ESMTPS id r6si7395413pai.159.2016.05.13.00.04.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 May 2016 00:04:21 -0700 (PDT) Received: by mail-pa0-x242.google.com with SMTP id zy2so9325345pac.2 for ; Fri, 13 May 2016 00:04:21 -0700 (PDT) Date: Fri, 13 May 2016 16:05:53 +0900 From: Sergey Senozhatsky Subject: Re: [PATCH] zram: introduce per-device debug_stat sysfs node Message-ID: <20160513070553.GC615@swordfish> References: <20160511134553.12655-1-sergey.senozhatsky@gmail.com> <20160512234143.GA27204@bbox> <20160513010929.GA615@swordfish> <20160513062303.GA21204@bbox> <20160513065805.GB615@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160513065805.GB615@swordfish> Sender: owner-linux-mm@kvack.org List-ID: To: Sergey Senozhatsky Cc: Minchan Kim , Sergey Senozhatsky , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org On (05/13/16 15:58), Sergey Senozhatsky wrote: > On (05/13/16 15:23), Minchan Kim wrote: > [..] > > @@ -737,12 +737,12 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index, > > zcomp_strm_release(zram->comp, zstrm); > > zstrm = NULL; > > > > - atomic64_inc(&zram->stats.num_recompress); > > - > > handle = zs_malloc(meta->mem_pool, clen, > > GFP_NOIO | __GFP_HIGHMEM); > > - if (handle) > > + if (handle) { > > + atomic64_inc(&zram->stats.num_recompress); > > goto compress_again; > > + } > > not like a real concern... > > the main (and only) purpose of num_recompress is to match performance > slowdowns and failed fast write paths (when the first zs_malloc() fails). > this matching is depending on successful second zs_malloc(), but if it's > also unsuccessful we would only increase failed_writes; w/o increasing > the failed fast write counter, while we actually would have failed fast > write and extra zs_malloc() [unaccounted in this case]. yet it's probably > a bit unlikely to happen, but still. well, just saying. here I assume that the biggest contributor to re-compress latency is enabled preemption after zcomp_strm_release() and this second zs_malloc(). the compression itself of a PAGE_SIZE buffer should be fast enough. so IOW we would pass down the slow path, but would not account it. -ss -- 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