Re: [PATCH 15/18] xfs; pack xfs_buf structure more tightly

Alex Elder
2010-09-15T18:00:28Z

On Tue, 2010-09-14 at 20:56 +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> pahole reports the struct xfs_buf has quite a few holes in it, so
> packing the structure better will reduce the size of it by 16 bytes.
> Also, move all the fields used in cache lookups into the first
> cacheline.
>
> Before on x86_64:
>
> /* size: 320, cachelines: 5 */
> /* sum members: 298, holes: 6, sum holes: 22 */
>
> After on x86_64:
>
> /* size: 304, cachelines: 5 */
> /* padding: 6 */
> /* last cacheline: 48 bytes */

Looks good.

Reviewed-by: Alex Elder <aelder@sgi.com>

> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> ---
> fs/xfs/linux-2.6/xfs_buf.h | 30 +++++++++++++++++++-----------
> 1 files changed, 19 insertions(+), 11 deletions(-)