lkml.org 
[lkml]   [2010]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] cfq: reorder cfq_queue removing padding on 64bit & allowing more objects/slab in it's kmem_cache
Date
Richard Kennedy <richard@rsk.demon.co.uk> writes:

> This removes 8 bytes of padding from struct cfq_queue on 64 bit builds,
> shrinking it's size to 256 bytes, so fitting into 1 fewer cachelines and
> allowing 1 more object/slab in it's kmem_cache.

OK, I ran pahole to verify your findings:

$ pahole -C cfq_queue build/master/block/cfq-iosched.o
struct cfq_queue {
...
unsigned int allocated_slice; /* 136 4 */
/* XXX 4 bytes hole, try to pack */
long unsigned int slice_start; /* 144 8 */
...
pid_t pid; /* 216 4 */
/* XXX 4 bytes hole, try to pack */
struct cfq_rb_root * service_tree; /* 224 8 */
...
/* size: 264, cachelines: 5, members: 34 */
/* sum members: 256, holes: 2, sum holes: 8 */
/* last cacheline: 8 bytes */
After applying the patch, it indeed does save a cacheline.

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>


\
 
 \ /
  Last update: 2010-02-15 18:03    [from the cache]
©2003-2011 Jasper Spaans