From: Minchan Kim <minchan@kernel.org>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] zram: export the number of available comp streams
Date: Tue, 22 Mar 2016 09:39:00 +0900 [thread overview]
Message-ID: <20160322003900.GC27197@bbox> (raw)
In-Reply-To: <20160321075128.GB501@swordfish>
Hello Sergey,
On Mon, Mar 21, 2016 at 04:51:28PM +0900, Sergey Senozhatsky wrote:
> 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)...
Indeed.
> -- remove __GFP_DIRECT_RECLAIM from pool gfp mask, which a bit is risky...
> IOW, make pool gfp '___GFP_KSWAPD_RECLAIM | __GFP_HIGHMEM'
Yeb. It would be okay for zram-swap but not zram-blk.
> -- kmalloc/kfree temp buffer for every RW op, which is ugly... because
> it sort of voids the whole purpose of per-cpu streams.
How about this?
zram_bvec_write()
{
retry:
*get_cpu_ptr(comp->stream);
zcomp_compress();
handle = zs_malloc((gfp &~ __GFP_DIRECT_RECLAIM| | GFP_NOWARN)
if (!handle) {
put_cpu_ptr(comp->stream);
handle = zs_malloc(gfp);
goto retry;
}
put_cpu_ptr(comp->stream);
}
If per-cpu model really performance win, it is worth to try.
next prev parent reply other threads:[~2016-03-22 0:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-26 12:03 [PATCH] zram: export the number of available comp streams Sergey Senozhatsky
2016-01-26 21:13 ` Andrew Morton
2016-01-27 0:34 ` Sergey Senozhatsky
2016-01-29 7:28 ` Minchan Kim
2016-02-01 1:02 ` Sergey Senozhatsky
2016-03-18 0:32 ` Minchan Kim
2016-03-18 1:09 ` Sergey Senozhatsky
2016-03-18 1:25 ` Minchan Kim
2016-03-21 7:51 ` Sergey Senozhatsky
2016-03-22 0:39 ` Minchan Kim [this message]
2016-03-23 8:01 ` Sergey Senozhatsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160322003900.GC27197@bbox \
--to=minchan@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sergey.senozhatsky.work@gmail.com \
--cc=sergey.senozhatsky@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.