[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Memory: use memory address space for cpu-memory
From: |
Xu, Anthony |
Subject: |
Re: [Qemu-devel] [PATCH] Memory: use memory address space for cpu-memory |
Date: |
Wed, 17 May 2017 17:01:11 +0000 |
> > If cpu-memory address space is same as memory address space,
> > use memory address space for cpu-memory address space.
> >
> > any memory region change causeaddress space to rebuild PhysPageMap,
> > rebuilding PhysPageMap is very expensive.
> >
> > removing cpu-memory address space reduces the guest boot time and
> > memory usage.
> >
> > Signed-off-by: Anthony Xu <address@hidden>
> > ---
> > cpus.c | 9 +++++++--
> > 1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/cpus.c b/cpus.c
> > index 740b8dc..15c7a6a 100644
> > --- a/cpus.c
> > +++ b/cpus.c
> > @@ -1748,8 +1748,13 @@ void qemu_init_vcpu(CPUState *cpu)
> > /* If the target cpu hasn't set up any address spaces itself,
> > * give it the default one.
> > */
> > - AddressSpace *as = address_space_init_shareable(cpu->memory,
> > - "cpu-memory");
> > + AddressSpace *as;
> > + if (cpu->memory == address_space_memory.root) {
> > + address_space_memory.ref_count++;
> probably this would cause reference leak when vcpu is destroyed
I thought address_space_destroy is called when vcpu is unplugged,
seems that's not the case, then ref_count++ is not needed.
Any other comments?
Thanks,
Anthony
- [Qemu-devel] [PATCH] Memory: use memory address space for cpu-memory, Anthony Xu, 2017/05/16
- Re: [Qemu-devel] [PATCH] Memory: use memory address space for cpu-memory, Igor Mammedov, 2017/05/17
- Re: [Qemu-devel] [PATCH] Memory: use memory address space for cpu-memory,
Xu, Anthony <=
- Re: [Qemu-devel] [PATCH] Memory: use memory address space for cpu-memory, Paolo Bonzini, 2017/05/18
- Re: [Qemu-devel] [PATCH] Memory: use memory address space for cpu-memory, Xu, Anthony, 2017/05/18
- Re: [Qemu-devel] [PATCH] Memory: use memory address space for cpu-memory, Paolo Bonzini, 2017/05/18
- Re: [Qemu-devel] [PATCH] Memory: use memory address space for cpu-memory, Xu, Anthony, 2017/05/18
- Re: [Qemu-devel] [PATCH] Memory: use memory address space for cpu-memory, Paolo Bonzini, 2017/05/19