Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751692Ab0HUQvE (ORCPT ); Sat, 21 Aug 2010 12:51:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7097 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751089Ab0HUQvC (ORCPT ); Sat, 21 Aug 2010 12:51:02 -0400 Message-ID: <4C7001C9.7050200@redhat.com> Date: Sat, 21 Aug 2010 11:41:45 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: Richard Kennedy CC: "Theodore Ts'o" , lkml , Andreas Dilger , linux-ext4@vger.kernel.org Subject: Re: [PATCH] ext4: remove alignment padding from ext4_inode_info on 64 bit builds References: <1282144088.2068.16.camel@castor.rsk> <4C6EE173.3030204@redhat.com> <1282393898.1978.18.camel@castor.rsk> In-Reply-To: <1282393898.1978.18.camel@castor.rsk> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2156 Lines: 57 Richard Kennedy wrote: > On Fri, 2010-08-20 at 15:11 -0500, Eric Sandeen wrote: >> Richard Kennedy wrote: >>> Reorder structure ext4_inode_info to remove 16 bytes of alignment >>> padding on 64 bit builds. This shrinks its size from 904 to 888 bytes >>> with (CONFIG_EXT4_S_XATTR=y && CONFIG_QUOTA=n). >>> >>> This will allow this structure to use one fewer cache lines. >>> >>> Also change type of i_delalloc_reserved_flag to bool to better reflect >>> its usage. >>> >>> compiled & tested on x86_64 >> >> Looks good to me; there is still a bit of padding at the end: >> >> qsize_t i_reserved_quota; /* 864 8 */ >> struct list_head i_completed_io_list; /* 872 16 */ >> spinlock_t i_completed_io_lock; /* 888 4 */ >> >> /* XXX 4 bytes hole, try to pack */ >> >> /* --- cacheline 14 boundary (896 bytes) --- */ >> ext4_io_end_t * cur_aio_dio; /* 896 8 */ >> tid_t i_sync_tid; /* 904 4 */ >> tid_t i_datasync_tid; /* 908 4 */ >> >> >> but it wouldn't save a cacheline anyway... >> >> -Eric >> > Thanks Eric, yes there is padding but we don't have anything to fill the > hole with :( > > If it becomes important to save space, i_state_flags seem to be unused > in ext4 so we could possibly drop that. Actually it is used, it's just expertly hidden in: EXT4_INODE_BIT_FNS(state, state_flags): #define EXT4_INODE_BIT_FNS(name, field) \ static inline int ext4_test_inode_##name(struct inode *inode, int bit) \ { \ return test_bit(bit, &EXT4_I(inode)->i_##field); \ } \ etc.. -Eric -- 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/