From: Chris Wright Subject: Re: How come same structure has different sizes for dom0 and domU Date: Fri, 9 Jun 2006 13:26:26 -0700 Message-ID: <20060609202626.GM2724@moss.sous-sol.org> References: <4d616cca0606091255o7f2f15e3xc2aac3f446dedaba@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <4d616cca0606091255o7f2f15e3xc2aac3f446dedaba@mail.gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Lily Huang Cc: xen-devel List-Id: xen-devel@lists.xenproject.org * Lily Huang (ushuanglily@gmail.com) 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