From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xensource.com, wei.liu2@citrix.com, jbeulich@suse.com
Subject: Re: Xen 4.6.0-rc1 build with lock_profile=y crash_debug=y, frame_pointer=y and domain.c:241: error: negative width in bit-field ‘<anonymous>’
Date: Tue, 25 Aug 2015 13:09:22 -0400 [thread overview]
Message-ID: <20150825170922.GD13402@l.oracle.com> (raw)
In-Reply-To: <55DC9C7A.1000404@citrix.com>
On Tue, Aug 25, 2015 at 05:48:58PM +0100, Andrew Cooper wrote:
> On 25/08/15 17:43, Konrad Rzeszutek Wilk wrote:
> > I am troubleshooting an locking issue and figured I would enable extra options.
> >
> > But now I am hitting this build issue:
> >
> > domain.c:241: error: negative width in bit-field ‘<anonymous>’
> >
> > Which is:
> >
> > 229 struct domain *alloc_domain_struct(void)
> > 230 {
> > 231 struct domain *d;
> > ...
> > 241 BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
> >
> > Thoughts?
>
> That is to catch the case where sizeof struct domain exceeds PAGE_SIZE.
>
> The logic behind this was to prevent needing order 1 allocations for
> domains or vcpus, and therefore allocation failures in heavily memory
> fragmented situations.
>
> It means we will probably need to find some other areas of struct domain
> to shrink, or move out into a separate xmalloc().
>
> For straight debugging, it is acceptable to drop the BUILD_BUG_ON(). If
> we can't drop the size of struct domain, we might want to move to using
> vmalloc() instead.
It is big. pahole says:
/* size: 4352, cachelines: 68, members: 74 */
/* sum members: 4238, holes: 9, sum holes: 34 */
/* padding: 80 */
/* paddings: 1, sum paddings: 4 */
Would this patch be OK then:
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 045f6ff..cc9ce0b 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -238,7 +238,9 @@ struct domain *alloc_domain_struct(void)
if ( unlikely(!bits) )
bits = _domain_struct_bits();
+#ifndef LOCK_PROFILE
BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE);
+#endif
d = alloc_xenheap_pages(0, MEMF_bits(bits));
if ( d != NULL )
clear_page(d);
(not compile tested nor runtime tested)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-08-25 17:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-25 16:43 Xen 4.6.0-rc1 build with lock_profile=y crash_debug=y, frame_pointer=y and domain.c:241: error: negative width in bit-field ‘<anonymous>’ Konrad Rzeszutek Wilk
2015-08-25 16:48 ` Andrew Cooper
2015-08-25 17:09 ` Konrad Rzeszutek Wilk [this message]
2015-08-25 17:41 ` Andrew Cooper
2015-08-25 19:52 ` Konrad Rzeszutek Wilk
2015-08-25 19:54 ` Konrad Rzeszutek Wilk
2015-08-26 7:32 ` Jan Beulich
2015-08-26 17:37 ` Konrad Rzeszutek Wilk
2015-08-26 18:54 ` Wei Liu
2015-08-26 7:28 ` Jan Beulich
2015-08-26 7:35 ` Jan Beulich
2015-08-25 16:51 ` Wei Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150825170922.GD13402@l.oracle.com \
--to=konrad.wilk@oracle.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.