Linux-mm Archive on lore.kernel.org
 help / color / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: [PATCH] zsmalloc: zspage sanity check
Date: Fri, 3 Jun 2016 10:01:29 +0900
Message-ID: <20160603010129.GC3304@bbox> (raw)

On Thu, Jun 02, 2016 at 09:25:19AM +0900, Minchan Kim wrote:
> On Wed, Jun 01, 2016 at 04:09:26PM +0200, Vlastimil Babka wrote:
> > On 06/01/2016 01:21 AM, Minchan Kim wrote:
> > 
> > [...]
> > 
> > > 
> > > Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> > > Signed-off-by: Minchan Kim <minchan@kernel.org>
> > 
> > I'm not that familiar with zsmalloc, so this is not a full review. I was
> > just curious how it's handling the movable migration API, and stumbled
> > upon some things pointed out below.
> > 
> > > @@ -252,16 +276,23 @@ struct zs_pool {
> > >   */
> > >  #define FULLNESS_BITS	2
> > >  #define CLASS_BITS	8
> > > +#define ISOLATED_BITS	3
> > > +#define MAGIC_VAL_BITS	8
> > >  
> > >  struct zspage {
> > >  	struct {
> > >  		unsigned int fullness:FULLNESS_BITS;
> > >  		unsigned int class:CLASS_BITS;
> > > +		unsigned int isolated:ISOLATED_BITS;
> > > +		unsigned int magic:MAGIC_VAL_BITS;
> > 
> > This magic seems to be only tested via VM_BUG_ON, so it's presence
> > should be also guarded by #ifdef DEBUG_VM, no?
> 
> Thanks for the point.
> 
> Then, I want to change it to BUG_ON because struct zspage corruption
> is really risky to work rightly and want to catch on it in real product
> which disable CONFIG_DEBUG_VM for a while until make the feature stable.

Andrew,

Please fold this patch into zsmalloc: page migration support.
Thanks!

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20160603010129.GC3304@bbox \
    --to=minchan@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=vbabka@suse.cz \
    /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

Linux-mm Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mm/0 linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ https://lore.kernel.org/linux-mm \
		linux-mm@kvack.org
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kvack.linux-mm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git