mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-07-08 11:10:36 +00:00
memory: Create FlatView directly
This avoids usual memory_region_transaction_commit() which rebuilds all FVs. On POWER8 with 255 CPUs, 255 virtio-net, 40 PCI bridges guest this brings down the boot time from 25s to 20s and reduces the amount of temporary FVs allocated during machine constructon (~800000 -> ~640000) and amount of temporary dispatch trees (~370000 -> ~300000), the total memory footprint goes down (18G -> 17G). Backports commit 202fc01b05572ecb258fdf4c5bd56cf6de8140c7 from qemu
This commit is contained in:
parent
1fd8b64072
commit
7eab335b2e
|
@ -880,6 +880,18 @@ static void address_space_set_flatview(AddressSpace *as)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void address_space_update_topology(AddressSpace *as)
|
||||||
|
{
|
||||||
|
MemoryRegion *physmr = memory_region_get_flatview_root(as->root);
|
||||||
|
struct uc_struct *uc = as->uc;
|
||||||
|
|
||||||
|
flatviews_init(uc);
|
||||||
|
if (!g_hash_table_lookup(uc->flat_views, physmr)) {
|
||||||
|
generate_memory_topology(physmr);
|
||||||
|
}
|
||||||
|
address_space_set_flatview(as);
|
||||||
|
}
|
||||||
|
|
||||||
void memory_region_transaction_begin(struct uc_struct *uc)
|
void memory_region_transaction_begin(struct uc_struct *uc)
|
||||||
{
|
{
|
||||||
++uc->memory_region_transaction_depth;
|
++uc->memory_region_transaction_depth;
|
||||||
|
@ -1883,15 +1895,14 @@ void address_space_init(struct uc_struct *uc, AddressSpace *as, MemoryRegion *ro
|
||||||
memory_init(uc);
|
memory_init(uc);
|
||||||
}
|
}
|
||||||
|
|
||||||
memory_region_transaction_begin(uc);
|
memory_region_ref(root);
|
||||||
as->uc = uc;
|
as->uc = uc;
|
||||||
as->root = root;
|
as->root = root;
|
||||||
as->current_map = NULL;
|
as->current_map = NULL;
|
||||||
QTAILQ_INIT(&as->listeners);
|
QTAILQ_INIT(&as->listeners);
|
||||||
QTAILQ_INSERT_TAIL(&uc->address_spaces, as, address_spaces_link);
|
QTAILQ_INSERT_TAIL(&uc->address_spaces, as, address_spaces_link);
|
||||||
as->name = g_strdup(name ? name : "anonymous");
|
as->name = g_strdup(name ? name : "anonymous");
|
||||||
uc->memory_region_update_pending |= root->enabled;
|
address_space_update_topology(as);
|
||||||
memory_region_transaction_commit(uc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_address_space_destroy(AddressSpace *as)
|
static void do_address_space_destroy(AddressSpace *as)
|
||||||
|
|
Loading…
Reference in a new issue