[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH RFC] domain: Compile with lock_profile=y enabled.
>>> On 06.11.15 at 20:39, <konrad.wilk@xxxxxxxxxx> wrote: > On Thu, Nov 05, 2015 at 10:12:26AM -0700, Jan Beulich wrote: >> >>> On 02.11.15 at 18:12, <konrad.wilk@xxxxxxxxxx> wrote: >> > @@ -247,10 +248,12 @@ struct domain *alloc_domain_struct(void) >> > bits = _domain_struct_bits(); >> > #endif >> > >> > - BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE); >> >> Not unconditionally (i.e. at least non-debug builds should continue >> to have this). > > The profile=y does not mandate debug=y? > > Meaning if we leave this for non-debug builds with lock_profile=y > we will have an compile issue. Good point, but still calling for this not to be done unconditionally (even if not a true dependency, I don't expect production builds to enable lock profiling). >> > - d = alloc_xenheap_pages(0, MEMF_bits(bits)); >> > + d = alloc_xenheap_pages(order, MEMF_bits(bits)); >> > if ( d != NULL ) >> > - clear_page(d); >> > + { >> > + for ( ; order >= 0; order-- ) >> > + clear_page((void *)d + PAGE_SIZE*order); >> >> This loop works for orders 0 and 1, but not anything else (not >> clearing all of the pages). > > Right. This below should do it: Yes, except that ... > @@ -243,10 +244,18 @@ struct domain *alloc_domain_struct(void) > bits = _domain_struct_bits(); > #endif > > + > +#ifndef LOCK_PROFILE > BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE); > - d = alloc_xenheap_pages(0, MEMF_bits(bits)); > +#endif > + d = alloc_xenheap_pages(order, MEMF_bits(bits)); > if ( d != NULL ) > - clear_page(d); > + { > + unsigned int sz; > + > + for ( sz = 0; sz < (1 << order) * PAGE_SIZE; sz += PAGE_SIZE ) ... this wants to be simplified to PAGE_SIZE << order. Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |