Skip to contentSkip to conversation

How come same structure has different sizes for dom0 and domU

DISCUSSION Lily Huang 2 participants 2 messages Jun 9, 2006

lore
Share & tools
lore

Lily Huang

author
#0 lore raw

I found that dentry and inode have different sizes in Dom0 and domU. In particular,

in Dom0:

dentry: 128 bytes
inode:  312 bytes

in DomU:

dentry: 132 bytes
inode: 344 bytes

How could this happen? Is there any way to make them same?

lily

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 9 lines · * Lily Huang ([email protected]) wrote:

in Dom0:

dentry: 128 bytes
inode:  312 bytes

in DomU:
dentry: 132 bytes
inode: 344 bytes

How could this happen? Is there any way to make them same?

Could be for many reasons. The most likely is .config differences (additional debugging or features set can increase the size of a structure like that). Since you didn't specify the source, could also be that the base source is from different versions.

Here's some simple examples:

struct dentry {
	...
	spinlock_t d_lock;
	...
#ifdef CONFIG_PROFILING
	struct dcookie_struct *d_cookie; /* cookie, if any */
#endif
	...
};
typedef struct {
	...
#if defined(CONFIG_PREEMPT) && defined(CONFIG_SMP)
	unsigned int break_lock;
#endif
	...
} spinlock_t;

So either CONFIG_PROFILING or CONFIG_PREEMPT && CONFIG_SMP would add those 4 bytes to the struct.

thanks,
-chris