Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1361565

Re: [PATCH] zram: export the number of available comp streams

From Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] zram: export the number of available comp streams
Date 2016-03-21 09:00 +0100
Message-ID <rf2UN-2uv-3@gated-at.bofh.it> (permalink)
References (1 earlier) <qWbFg-7NP-5@gated-at.bofh.it> <qXba9-3n0-3@gated-at.bofh.it> <rdQCm-6sf-7@gated-at.bofh.it> <rdR5o-6Vq-11@gated-at.bofh.it> <rdRoK-72X-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] zram: export the number of available comp streams Minchan Kim <minchan@kernel.org> - 2016-03-18 01:40 +0100
  Re: [PATCH] zram: export the number of available comp streams Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-18 02:10 +0100
    Re: [PATCH] zram: export the number of available comp streams Minchan Kim <minchan@kernel.org> - 2016-03-18 02:30 +0100
      Re: [PATCH] zram: export the number of available comp streams Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-21 09:00 +0100
        Re: [PATCH] zram: export the number of available comp streams Minchan Kim <minchan@kernel.org> - 2016-03-22 01:40 +0100
          Re: [PATCH] zram: export the number of available comp streams Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-23 09:00 +0100

csiph-web