Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967208AbdD3LcV (ORCPT ); Sun, 30 Apr 2017 07:32:21 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36552 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S939218AbdD3LcF (ORCPT ); Sun, 30 Apr 2017 07:32:05 -0400 From: Wei Yang To: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH 1/3] mm/slub: pack red_left_pad with another int to save a word Date: Sun, 30 Apr 2017 19:31:50 +0800 Message-Id: <20170430113152.6590-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170430113152.6590-1-richard.weiyang@gmail.com> References: <20170430113152.6590-1-richard.weiyang@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 947 Lines: 28 On 64bit arch, struct is 8-bytes aligned, so int will occupy a word if it doesn't sits well. This patch pack red_left_pad with reserved to save 8 bytes for struct kmem_cache on a 64bit arch. Signed-off-by: Wei Yang --- include/linux/slub_def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 07ef550c6627..ec13aab32647 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h @@ -79,9 +79,9 @@ struct kmem_cache { int inuse; /* Offset to metadata */ int align; /* Alignment */ int reserved; /* Reserved bytes at the end of slabs */ + int red_left_pad; /* Left redzone padding size */ const char *name; /* Name (only for display!) */ struct list_head list; /* List of slab caches */ - int red_left_pad; /* Left redzone padding size */ #ifdef CONFIG_SYSFS struct kobject kobj; /* For sysfs */ #endif -- 2.11.0