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: <20160321075128.GB501@swordfish>
Date:	Mon, 21 Mar 2016 16:51:28 +0900
From:	Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To:	Minchan Kim <minchan@...nel.org>
Cc:	Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
	Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] zram: export the number of available comp streams

Hello Minchan,

On (03/18/16 10:25), Minchan Kim wrote:
[..]
> > aha, ok.
> > 
> > > (ie, simple code, removing
> > > max_comp_streams knob, no need to this your stat, guarantee parallel
> > > level, guarantee consumed memory space).
> > 
> > I'll take a look and prepare some numbers (most likely next week).
> 
> Sounds great to me!

so I have schematically this thing now. streams are per-cpu and contain
scratch buffer and work mem.

zram_bvec_write()
{
	*get_cpu_ptr(comp->stream);
	 zcomp_compress();
	 zs_malloc()
	put_cpu_ptr(comp->stream);
}

this, however, makes zsmalloc unhapy. pool has GFP_NOIO | __GFP_HIGHMEM
gfp, and GFP_NOIO is ___GFP_DIRECT_RECLAIM|___GFP_KSWAPD_RECLAIM. this
__GFP_DIRECT_RECLAIM is in the conflict with per-cpu streams, because
per-cpu streams require disabled preemption (up until we copy stream
buffer to zspage). so what options do we have here... from the top of
my head (w/o a lot of thinking)...
-- remove __GFP_DIRECT_RECLAIM from pool gfp mask, which a bit is risky...
IOW, make pool gfp '___GFP_KSWAPD_RECLAIM | __GFP_HIGHMEM'
-- kmalloc/kfree temp buffer for every RW op, which is ugly... because
it sort of voids the whole purpose of per-cpu streams.
-- ... hm.

	-ss

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ