Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1214588 > unrolled thread

[PATCHv4 7/7] mm: use 'unsigned int' for compound_dtor/compound_order on 64BIT

Started by"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
First post2015-08-27 16:10 +0200
Last post2015-08-27 17:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCHv4 7/7] mm: use 'unsigned int' for compound_dtor/compound_order on 64BIT "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2015-08-27 16:10 +0200
    Re: [PATCHv4 7/7] mm: use 'unsigned int' for  compound_dtor/compound_order on 64BIT Michal Hocko <mhocko@kernel.org> - 2015-08-27 17:20 +0200

#1214588 — [PATCHv4 7/7] mm: use 'unsigned int' for compound_dtor/compound_order on 64BIT

From"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Date2015-08-27 16:10 +0200
Subject[PATCHv4 7/7] mm: use 'unsigned int' for compound_dtor/compound_order on 64BIT
Message-ID<q262m-6Gi-15@gated-at.bofh.it>
On 64 bit system we have enough space in struct page to encode
compound_dtor and compound_order with unsigned int.

On x86-64 it leads to slightly smaller code size due usesage of plain
MOV instead of MOVZX (zero-extended move) or similar effect.

allyesconfig:

   text	   data	    bss	    dec	    hex	filename
159520446	48146736	72196096	279863278	10ae5fee	vmlinux.pre
159520382	48146736	72196096	279863214	10ae5fae	vmlinux.post

On other architectures without native support of 16-bit data types the
difference can be bigger.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
 include/linux/mm_types.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index ecaf3b1d0216..39b0db74ba5e 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -150,8 +150,13 @@ struct page {
 		/* First tail page of compound page */
 		struct {
 			unsigned long compound_head; /* If bit zero is set */
+#ifdef CONFIG_64BIT
+			unsigned int compound_dtor;
+			unsigned int compound_order;
+#else
 			unsigned short int compound_dtor;
 			unsigned short int compound_order;
+#endif
 		};
 
 #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && USE_SPLIT_PMD_PTLOCKS
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1214639 — Re: [PATCHv4 7/7] mm: use 'unsigned int' for compound_dtor/compound_order on 64BIT

FromMichal Hocko <mhocko@kernel.org>
Date2015-08-27 17:20 +0200
SubjectRe: [PATCHv4 7/7] mm: use 'unsigned int' for compound_dtor/compound_order on 64BIT
Message-ID<q2786-8ds-17@gated-at.bofh.it>
In reply to#1214588
On Thu 27-08-15 16:59:21, Kirill A. Shutemov wrote:
> On 64 bit system we have enough space in struct page to encode
> compound_dtor and compound_order with unsigned int.
> 
> On x86-64 it leads to slightly smaller code size due usesage of plain
> MOV instead of MOVZX (zero-extended move) or similar effect.
> 
> allyesconfig:
> 
>    text	   data	    bss	    dec	    hex	filename
> 159520446	48146736	72196096	279863278	10ae5fee	vmlinux.pre
> 159520382	48146736	72196096	279863214	10ae5fae	vmlinux.post

64B is not much, really, but if that works as a microptimization then I
have no objections.

> On other architectures without native support of 16-bit data types the
> difference can be bigger.

Thank you for pulling this out of the original patch.

> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  include/linux/mm_types.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index ecaf3b1d0216..39b0db74ba5e 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -150,8 +150,13 @@ struct page {
>  		/* First tail page of compound page */
>  		struct {
>  			unsigned long compound_head; /* If bit zero is set */
> +#ifdef CONFIG_64BIT
> +			unsigned int compound_dtor;
> +			unsigned int compound_order;
> +#else
>  			unsigned short int compound_dtor;
>  			unsigned short int compound_order;
> +#endif
>  		};
>  
>  #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && USE_SPLIT_PMD_PTLOCKS
> -- 
> 2.5.0

-- 
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web