From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Yinghao Xie <yinghao.xie@samsung.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
Subject: Re: mm/zsmalloc.c: count in handle's size when calculating pages_per_zspage
Date: Fri, 20 Mar 2015 14:55:59 +0900 [thread overview]
Message-ID: <20150320055559.GA23604@swordfish> (raw)
In-Reply-To: <430707086.362221426765159948.JavaMail.weblogic@epmlwas05d>
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
> 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
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2015-03-20 5:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-19 11:39 Yinghao Xie
2015-03-20 4:55 ` Minchan Kim
2015-03-20 5:55 ` Sergey Senozhatsky [this message]
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=20150320055559.GA23604@swordfish \
--to=sergey.senozhatsky.work@gmail.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@gmail.com \
--cc=yinghao.xie@samsung.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