From patchwork Tue Jun 7 10:46:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: richard kennedy X-Patchwork-Id: 855792 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p57Akrmn020768 for ; Tue, 7 Jun 2011 10:46:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751819Ab1FGKqd (ORCPT ); Tue, 7 Jun 2011 06:46:33 -0400 Received: from anchor-post-3.mail.demon.net ([195.173.77.134]:40362 "EHLO anchor-post-3.mail.demon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751261Ab1FGKqd (ORCPT ); Tue, 7 Jun 2011 06:46:33 -0400 Received: from rsk.demon.co.uk ([80.176.90.227] helo=[192.168.1.3]) by anchor-post-3.mail.demon.net with esmtp (Exim 4.69) id 1QTtns-0000sU-nL; Tue, 07 Jun 2011 10:46:32 +0000 Subject: btrfs: remove 64bit alignment padding to allow extent_buffer to fit into one fewer cacheline From: Richard Kennedy To: "chris.mason" Cc: lkml , linux-btrfs@vger.kernel.org Date: Tue, 07 Jun 2011 11:46:32 +0100 X-Mailer: Evolution 3.0.2 (3.0.2-1.fc15) Message-ID: <1307443592.2076.7.camel@castor.rsk> Mime-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 07 Jun 2011 10:46:54 +0000 (UTC) Reorder extent_buffer to remove 8 bytes of alignment padding on 64 bit builds. This shrinks its size to 128 bytes allowing it to fit into one fewer cache lines and allows more objects per slab in its kmem_cache. slabinfo extent_buffer reports :- before:- Sizes (bytes) Slabs ---------------------------------- Object : 136 Total : 123 SlabObj: 136 Full : 121 SlabSiz: 4096 Partial: 0 Loss : 0 CpuSlab: 2 Align : 8 Objects: 30 after :- Object : 128 Total : 4 SlabObj: 128 Full : 2 SlabSiz: 4096 Partial: 0 Loss : 0 CpuSlab: 2 Align : 8 Objects: 32 Signed-off-by: Richard Kennedy --- patch against v3.0-rc2 compiled & tested on x86_64 This has only had a little light testing on a scratch volume but it still seems to work. regards Richard -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index 4e8445a..a11a92e 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h @@ -126,9 +126,9 @@ struct extent_buffer { unsigned long map_len; struct page *first_page; unsigned long bflags; - atomic_t refs; struct list_head leak_list; struct rcu_head rcu_head; + atomic_t refs; /* the spinlock is used to protect most operations */ spinlock_t lock;