[OpenAFS-devel] RE: [OpenAFS] Strange Behavior of Openafs-1.1
.1
Jean-Marc Saffroy
saffroy@ri.silicomp.fr
Thu, 9 Aug 2001 01:04:14 +0200 (CEST)
On Wed, 8 Aug 2001, Jeffrey Hutzelman wrote:
> On Wed, 8 Aug 2001, Neulinger, Nathan wrote:
>
> > I just took another look over fs.h and osi_vfs.h and I'm confused...
> >
> > What fields are the extra data that AFS is adding? Looks to me like struct
> > vnode_t is 100% identical to the existing struct inode, with the exception
> > that the fs-specific union appears to be alot smaller in the vnode_t one.
>
> That's essentially correct. The problem is that the union is quite large,
> so there's a lot of overhead to including that extra space in every vnode.
The size of the union is that of its largest member. We can check the
exact sizes with objdump -g, here on a Linux 2.4.6 VFS inode :
struct inode { /* size 464 id 6 */
...
union %anon38 { /* size 196 */
...
struct ext2_inode_info /* id 40 */ ext2_i; /* bitsize 928, bitpos 0 */
...
struct nfs_inode_info /* id 46 */ nfs_i; /* bitsize 1568, bitpos 0 */
...
} u; /* bitsize 1568, bitpos 2144 */
};
The largest member is nfs_inode_info, and its first runner up is
ext2_inode_info. There are a few other members that are barely smaller.
Removing nfs_inode_info would save 80 bytes, which would decrease the
total inode size by 17%. I'd say that wasting these bytes is no big deal,
especially if it means that it gives you the benefit of the slab allocator
(which allocates fixed size chunks).
--
Jean-Marc Saffroy - Research Engineer - Silicomp Research Institute
mailto:saffroy@ri.silicomp.fr