All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	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: Mon, 21 Mar 2016 16:51:28 +0900	[thread overview]
Message-ID: <20160321075128.GB501@swordfish> (raw)
In-Reply-To: <20160318012524.GA10612@bbox>

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

  reply	other threads:[~2016-03-21  7:51 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 [this message]
2016-03-22  0:39             ` Minchan Kim
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=20160321075128.GB501@swordfish \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan@kernel.org \
    --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.