Skip to content

Commit

Permalink
btrfs: remove 64bit alignment padding to allow extent_buffer to fit i…
Browse files Browse the repository at this point in the history
…nto one fewer cacheline

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 <richard@rsk.demon.co.uk>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
richard kennedy authored and Chris Mason committed Jun 10, 2011
1 parent 38e8805 commit 9eb9104
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/extent_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9eb9104

Please sign in to comment.