* [PATCH 0/6] x86: break up post-boot non-order-zero allocations
@ 2011-04-05 8:19 Jan Beulich
2011-04-05 11:59 ` Keir Fraser
2011-04-06 2:50 ` Dan Magenheimer
0 siblings, 2 replies; 4+ messages in thread
From: Jan Beulich @ 2011-04-05 8:19 UTC (permalink / raw)
To: xen-devel@lists.xensource.com
While tmem is most affected by this, due to fragmentation it is generally
a bad idea to require runtime allocations of more than a single page in
size.
1: remove direct cpumask_t members from struct vcpu and struct domain
2: x86: split struct vcpu
3: x86: move pv-only members of struct vcpu to struct pv_vcpu
4: x86: split struct domain
5: x86: introduce alloc_vcpu_guest_context()
6: passthrough: use domain pirq as index of struct hvm_irq_dpci's hvm_timer array
With this, structure sizes are below page size, and no longer depend
significantly on NR_CPUS. This series, however, doesn't eliminate
all non-order-zero allocations that happen post boot (i.e. mostly
during domain creation). Items that are known to need addressing
are
- nr_irqs-sized allocation of ->arch.irq_pirq[] in
xen/arch/x86/domain.c:arch_domain_create()
- ->nr_pirqs-sized allocations in
xen/drivers/passthrough/io.c:pt_irq_create_bind_vtd()
- ->nr_pirqs-sized allocation of ->arch.pirq_irq[] in
xen/arch/x86/domain.c:arch_domain_create()
- ->nr_pirqs-sized allocation of ->pirq_to_evtchn[] in
xen/common/domain.c:domain_create()
Signed-off-by: Jan Beulich <jbeulich@novell.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 0/6] x86: break up post-boot non-order-zero allocations
2011-04-05 8:19 [PATCH 0/6] x86: break up post-boot non-order-zero allocations Jan Beulich
@ 2011-04-05 11:59 ` Keir Fraser
2011-04-06 2:50 ` Dan Magenheimer
1 sibling, 0 replies; 4+ messages in thread
From: Keir Fraser @ 2011-04-05 11:59 UTC (permalink / raw)
To: Jan Beulich, xen-devel@lists.xensource.com
On 05/04/2011 09:19, "Jan Beulich" <JBeulich@novell.com> wrote:
> With this, structure sizes are below page size, and no longer depend
> significantly on NR_CPUS. This series, however, doesn't eliminate
> all non-order-zero allocations that happen post boot (i.e. mostly
> during domain creation). Items that are known to need addressing
> are
> - nr_irqs-sized allocation of ->arch.irq_pirq[] in
> xen/arch/x86/domain.c:arch_domain_create()
> - ->nr_pirqs-sized allocations in
> xen/drivers/passthrough/io.c:pt_irq_create_bind_vtd()
> - ->nr_pirqs-sized allocation of ->arch.pirq_irq[] in
> xen/arch/x86/domain.c:arch_domain_create()
> - ->nr_pirqs-sized allocation of ->pirq_to_evtchn[] in
> xen/common/domain.c:domain_create()
I wonder whether some of these irq-indexed and pirq-indexed values could be
agregated together into two separate structs, and then keep them in
irq-indexed and a pirq-indexed radix trees? It might actually be more space
efficient if nr_irqs or nr_pirqs is large, quite apart from the benefit of
getting rid of the multi-page allocations.
-- Keir
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH 0/6] x86: break up post-boot non-order-zero allocations
2011-04-05 8:19 [PATCH 0/6] x86: break up post-boot non-order-zero allocations Jan Beulich
2011-04-05 11:59 ` Keir Fraser
@ 2011-04-06 2:50 ` Dan Magenheimer
2011-04-06 6:46 ` Jan Beulich
1 sibling, 1 reply; 4+ messages in thread
From: Dan Magenheimer @ 2011-04-06 2:50 UTC (permalink / raw)
To: Jan Beulich, xen-devel
Thanks very much Jan for making forward progress on this!
A couple things:
IIRC, PCI-passthrough is another user of multi-page allocations.
At some point, does it make sense to eliminate the multi-page
allocation functionality, at least through the "normal"
page allocation routines, and add a:
/* documentation about why not to use this */
alloc_contiguous_pages_DEPRECATED(order)
call so that it is very explicit when future page allocation
users "regress" by adding a multi-page allocation request?
Thanks again!
Dan
> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@novell.com]
> Sent: Tuesday, April 05, 2011 2:19 AM
> To: xen-devel@lists.xensource.com
> Subject: [Xen-devel] [PATCH 0/6] x86: break up post-boot non-order-zero
> allocations
>
> While tmem is most affected by this, due to fragmentation it is
> generally
> a bad idea to require runtime allocations of more than a single page in
> size.
>
> 1: remove direct cpumask_t members from struct vcpu and struct domain
> 2: x86: split struct vcpu
> 3: x86: move pv-only members of struct vcpu to struct pv_vcpu
> 4: x86: split struct domain
> 5: x86: introduce alloc_vcpu_guest_context()
> 6: passthrough: use domain pirq as index of struct hvm_irq_dpci's
> hvm_timer array
>
> With this, structure sizes are below page size, and no longer depend
> significantly on NR_CPUS. This series, however, doesn't eliminate
> all non-order-zero allocations that happen post boot (i.e. mostly
> during domain creation). Items that are known to need addressing
> are
> - nr_irqs-sized allocation of ->arch.irq_pirq[] in
> xen/arch/x86/domain.c:arch_domain_create()
> - ->nr_pirqs-sized allocations in
> xen/drivers/passthrough/io.c:pt_irq_create_bind_vtd()
> - ->nr_pirqs-sized allocation of ->arch.pirq_irq[] in
> xen/arch/x86/domain.c:arch_domain_create()
> - ->nr_pirqs-sized allocation of ->pirq_to_evtchn[] in
> xen/common/domain.c:domain_create()
>
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH 0/6] x86: break up post-boot non-order-zero allocations
2011-04-06 2:50 ` Dan Magenheimer
@ 2011-04-06 6:46 ` Jan Beulich
0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2011-04-06 6:46 UTC (permalink / raw)
To: Dan Magenheimer; +Cc: xen-devel
>>> On 06.04.11 at 04:50, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
> IIRC, PCI-passthrough is another user of multi-page allocations.
As noted in the description, with the intended solution being to
switch from arrays to radix trees. Or do you know of other than
the mentioned cases?
> At some point, does it make sense to eliminate the multi-page
> allocation functionality, at least through the "normal"
> page allocation routines, and add a:
>
> /* documentation about why not to use this */
> alloc_contiguous_pages_DEPRECATED(order)
>
> call so that it is very explicit when future page allocation
> users "regress" by adding a multi-page allocation request?
I wouldn't go that far. Instead I was considering adding a (perhaps
one-time) warning so that things wouldn't start outright failing, but
remaining code paths get pointed out. But that ought to happen
only once all known allocations have been dealt with.
Jan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-04-06 6:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-05 8:19 [PATCH 0/6] x86: break up post-boot non-order-zero allocations Jan Beulich
2011-04-05 11:59 ` Keir Fraser
2011-04-06 2:50 ` Dan Magenheimer
2011-04-06 6:46 ` Jan Beulich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).