Whamcloud - gitweb
LU-1665 libcfs: alignment of hsb_head[0] can be suboptimal
authorchas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Fri, 10 Aug 2012 19:21:10 +0000 (15:21 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 23 Jan 2013 17:34:38 +0000 (12:34 -0500)
commita88b34fe120563967732b98326a9a35f2374a5c8
tree0cd2f19861f7f4fdec2f97a8ea83ed2c515e7fc6
parenta5b6ed491a5fcbe593f0fb8162b7be11d07ba4de
LU-1665 libcfs: alignment of hsb_head[0] can be suboptimal

On ia64, hsb_head[0] of struct cfs_hash_bucket could be aligned to a
4-byte boundary.  However, after allocating the hash bucket and
casting, the first member of the struct pointed to by hsb_head[0]
might prefer an 8-byte alignment.  This causes a constant stream
of unaligned access warnings from the kernel.

For other cpus this might waste some small amount of space, but
potentially produces more natural alignments (8 byte objects on 8
byte boundaries).

Signed-off-by: chas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Change-Id: I4561ab3e6553b5dcef840b8e4e9aa3023b7c3586
Reviewed-on: http://review.whamcloud.com/4965
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
libcfs/include/libcfs/libcfs_hash.h