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]
Date:	Fri, 13 May 2016 10:09:29 +0900
From:	Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To:	Minchan Kim <minchan@...nel.org>
Cc:	Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Subject: Re: [PATCH] zram: introduce per-device debug_stat sysfs node

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 <minchan@...nel.org>
> 

thanks.

	-ss

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ