From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753528AbcEMXFQ (ORCPT ); Fri, 13 May 2016 19:05:16 -0400 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:33570 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751201AbcEMXFN (ORCPT ); Fri, 13 May 2016 19:05:13 -0400 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 165.244.98.203 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org Date: Sat, 14 May 2016 08:05:46 +0900 From: Minchan Kim To: Sergey Senozhatsky CC: Sergey Senozhatsky , Andrew Morton , , Subject: Re: [PATCH] zram: introduce per-device debug_stat sysfs node Message-ID: <20160513230546.GA26763@bbox> References: <20160511134553.12655-1-sergey.senozhatsky@gmail.com> <20160512234143.GA27204@bbox> <20160513010929.GA615@swordfish> <20160513062303.GA21204@bbox> <20160513065805.GB615@swordfish> <20160513070553.GC615@swordfish> <20160513072006.GA21484@bbox> <20160513080643.GE615@swordfish> MIME-Version: 1.0 In-Reply-To: <20160513080643.GE615@swordfish> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB02/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/05/14 08:05:09, Serialize by Router on LGEKRMHUB02/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/05/14 08:05:10, Serialize complete at 2016/05/14 08:05:10 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Sergey, On Fri, May 13, 2016 at 05:06:43PM +0900, Sergey Senozhatsky wrote: > On (05/13/16 16:20), 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; > > > > > + } > > > just a small note: > > > Although 2 is smaller, your patch just accounts only direct reclaim but my > > suggestion can count both 1 and 2 so isn't it better? > > no, my patch accounts 1) and 2) as well. the only difference is that my > patch accounts second zs_malloc() call _EVEN_ if it has failed and we > jumped to goto err (because we still could have done reclaim). the new > version would account second zs_malloc() _ONLY_ if it has succeeded, and > thus possibly reclaim would not be accounted. > > > recompress: > compress > handle = zs_malloc FAST PATH > > if (!handle) { > release stream > handle = zs_malloc SLOW PATH > > << my patch accounts SLOW PATH here >> > > if (handle) { > num_recompress++ << NEW version accounts it here, only it was OK >> > goto recompress; > } > > goto err; << SLOW PATH is not accounted if SLOW PATH was unsuccessful > } > I got your point. You want to account every slow path and change the naming from num_recompress to something to show that slow path. Sorry for catching your point too late. And I absolutely agree with you. I want to name it with 'writestall' like MM's allocstall. :) Now I saw you sent new version but I like your suggestion more. I will send new verion by hand :) Thanks for the arguing. It was worth!