lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160513230546.GA26763@bbox>
Date:	Sat, 14 May 2016 08:05:46 +0900
From:	Minchan Kim <minchan@...nel.org>
To:	Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
CC:	Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	<linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>
Subject: Re: [PATCH] zram: introduce per-device debug_stat sysfs node

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!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ