linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yinghao Xie <yinghao.xie@samsung.com>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Minchan Kim <minchan@kernel.org>, Nitin Gupta <ngupta@vflare.org>,
	mm <linux-mm@kvack.org>, lkml <linux-kernel@vger.kernel.org>,
	"sergey.senozhatsky@gmail.com" <sergey.senozhatsky@gmail.com>
Subject: Re: Re: mm/zsmalloc.c: count in handle's size when calculating pages_per_zspage
Date: Fri, 20 Mar 2015 07:06:36 +0000 (GMT)	[thread overview]
Message-ID: <660418108.41771426835194470.JavaMail.weblogic@epmlwas06d> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 1377 bytes --]

> Hello,
> 
> sorry, I've a question.
> 
> On (03/19/15 11:39), Yinghao Xie wrote:
> > @@ -1426,11 +1430,6 @@ unsigned long zs_malloc(struct zs_pool *pool,
> size_t size)
> >  	/* extra space in chunk to keep the handle */
> >  	size += ZS_HANDLE_SIZE;
> >  	class = pool->size_class[get_size_class_index(size)];
> > -	/* In huge class size, we store the handle into first_page->private */
> > -	if (class->huge) {
> > -		size -= ZS_HANDLE_SIZE;
> > -		class = pool->size_class[get_size_class_index(size)];
> > -	}
> 
> if huge class uses page->private to store a handle, shouldn't we pass "size -=
> ZS_HANDLE_SIZE" to get_size_class_index() ?
> 
> 	-ss
> 
yes, you're right.it's my misunderstanding, thanks.

> >  	spin_lock(&class->lock);
> >  	first_page = find_get_zspage(class); @@ -1856,9 +1855,7 @@ struct
> > zs_pool *zs_create_pool(char *name, gfp_t flags)
> >  		struct size_class *class;
> >
> >  		size = ZS_MIN_ALLOC_SIZE + i * ZS_SIZE_CLASS_DELTA;
> > -		if (size > ZS_MAX_ALLOC_SIZE)
> > -			size = ZS_MAX_ALLOC_SIZE;
> > -		pages_per_zspage = get_pages_per_zspage(size);
> > +		pages_per_zspage = get_pages_per_zspage(size +
> ZS_HANDLE_SIZE);
> >
> >  		/*
> >  		 * size_class is used for normal zsmalloc operation such

N‹§²æìr¸›zǧu©ž²Æ {\b­†éì¹»\x1c®&Þ–)îÆi¢žØ^n‡r¶‰šŽŠÝ¢j$½§$¢¸\x05¢¹¨­è§~Š'.)îÄÃ,yèm¶ŸÿÃ\f%Š{±šj+ƒðèž×¦j)Z†·Ÿ

             reply	other threads:[~2015-03-20  7:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20  7:06 Yinghao Xie [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-03-20  7:01 Yinghao Xie

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=660418108.41771426835194470.JavaMail.weblogic@epmlwas06d \
    --to=yinghao.xie@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox