linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Weijie Yang <weijie.yang@samsung.com>
Cc: 'Andrew Morton' <akpm@linux-foundation.org>,
	'Minchan Kim' <minchan@kernel.org>,
	sergey.senozhatsky.work@gmail.com, ngupta@vflare.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] zsmalloc: reorganize struct size_class to pack 4 bytes hole
Date: Fri, 11 Dec 2015 15:14:47 +0900	[thread overview]
Message-ID: <20151211061447.GA6950@swordfish> (raw)
In-Reply-To: <"000001d133d3$b75f09b0$261d1d10$@yang"@samsung.com>

Cc linux-mm and linux-kernel

On (12/11/15 13:20), Weijie Yang wrote:
> 
> Reoder the pages_per_zspage field in struct size_class which can eliminate
> the 4 bytes hole between it and stats field.
> 

Looks good to me.

Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

> Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
> ---
>  mm/zsmalloc.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
> index 9f15bdd..e7414ce 100644
> --- a/mm/zsmalloc.c
> +++ b/mm/zsmalloc.c
> @@ -213,10 +213,10 @@ struct size_class {
>  	int size;
>  	unsigned int index;
>  
> -	/* Number of PAGE_SIZE sized pages to combine to form a 'zspage' */
> -	int pages_per_zspage;
>  	struct zs_size_stat stats;
>  
> +	/* Number of PAGE_SIZE sized pages to combine to form a 'zspage' */
> +	int pages_per_zspage;
>  	/* huge object: pages_per_zspage == 1 && maxobj_per_zspage == 1 */
>  	bool huge;
>  };


we also can re-order `struct zs_pool' -- `gfp_t flags' and `bool shrinker_enabled'
will be fine together.

I can send a separate patch of we can fold the one below.
I'm good either way.

---

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 9f15bdd..2a3af25 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -246,19 +246,17 @@ struct zs_pool {
 
 	struct size_class **size_class;
 	struct kmem_cache *handle_cachep;
-
-	gfp_t flags;	/* allocation flags used when growing pool */
-	atomic_long_t pages_allocated;
-
 	struct zs_pool_stats stats;
-
-	/* Compact classes */
-	struct shrinker shrinker;
+	atomic_long_t pages_allocated;
+	/* allocation flags used when growing pool */
+	gfp_t flags;
 	/*
 	 * To signify that register_shrinker() was successful
 	 * and unregister_shrinker() will not Oops.
 	 */
 	bool shrinker_enabled;
+	/* Compact classes */
+	struct shrinker shrinker;
 #ifdef CONFIG_ZSMALLOC_STAT
 	struct dentry *stat_dentry;
 #endif

--
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>

           reply	other threads:[~2015-12-11  6:13 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <"000001d133d3$b75f09b0$261d1d10$@yang"@samsung.com>]

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=20151211061447.GA6950@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=weijie.yang@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;
as well as URLs for NNTP newsgroup(s).