Re: [PATCH] zram: introduce per-device debug_stat sysfs node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
	}


	-ss

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]