From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753478AbbIJLen (ORCPT ); Thu, 10 Sep 2015 07:34:43 -0400 Received: from mx2.suse.de ([195.135.220.15]:40958 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752157AbbIJLem (ORCPT ); Thu, 10 Sep 2015 07:34:42 -0400 Subject: Re: [PATCHv5 7/7] mm: use 'unsigned int' for compound_dtor/compound_order on 64BIT To: "Kirill A. Shutemov" , Andrew Morton , Hugh Dickins References: <1441283758-92774-1-git-send-email-kirill.shutemov@linux.intel.com> <1441283758-92774-8-git-send-email-kirill.shutemov@linux.intel.com> Cc: Andrea Arcangeli , Dave Hansen , Johannes Weiner , Michal Hocko , David Rientjes , "Aneesh Kumar K.V" , linux-kernel@vger.kernel.org, linux-mm@kvack.org From: Vlastimil Babka Message-ID: <55F16ACD.2010104@suse.cz> Date: Thu, 10 Sep 2015 13:34:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <1441283758-92774-8-git-send-email-kirill.shutemov@linux.intel.com> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/03/2015 02:35 PM, 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 > > On other architectures without native support of 16-bit data types the > difference can be bigger. > > Signed-off-by: Kirill A. Shutemov > Acked-by: Michal Hocko > --- > 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 */ I'm indifferent to this change. But some comment here to explain would avoid git blame to figure out why it's done? > +#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 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by kanga.kvack.org (Postfix) with ESMTP id 895976B0038 for ; Thu, 10 Sep 2015 07:34:42 -0400 (EDT) Received: by wicge5 with SMTP id ge5so21089367wic.0 for ; Thu, 10 Sep 2015 04:34:42 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id bh4si699524wjb.66.2015.09.10.04.34.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Sep 2015 04:34:41 -0700 (PDT) Subject: Re: [PATCHv5 7/7] mm: use 'unsigned int' for compound_dtor/compound_order on 64BIT References: <1441283758-92774-1-git-send-email-kirill.shutemov@linux.intel.com> <1441283758-92774-8-git-send-email-kirill.shutemov@linux.intel.com> From: Vlastimil Babka Message-ID: <55F16ACD.2010104@suse.cz> Date: Thu, 10 Sep 2015 13:34:37 +0200 MIME-Version: 1.0 In-Reply-To: <1441283758-92774-8-git-send-email-kirill.shutemov@linux.intel.com> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: "Kirill A. Shutemov" , Andrew Morton , Hugh Dickins Cc: Andrea Arcangeli , Dave Hansen , Johannes Weiner , Michal Hocko , David Rientjes , "Aneesh Kumar K.V" , linux-kernel@vger.kernel.org, linux-mm@kvack.org On 09/03/2015 02:35 PM, 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 > > On other architectures without native support of 16-bit data types the > difference can be bigger. > > Signed-off-by: Kirill A. Shutemov > Acked-by: Michal Hocko > --- > 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 */ I'm indifferent to this change. But some comment here to explain would avoid git blame to figure out why it's done? > +#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 > -- 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: email@kvack.org