[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH qemu v4 12/18] memory: Share FlatView's and disp
From: |
Alexey Kardashevskiy |
Subject: |
Re: [Qemu-devel] [PATCH qemu v4 12/18] memory: Share FlatView's and dispatch trees between address spaces |
Date: |
Thu, 21 Sep 2017 09:53:10 +1000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 21/09/17 03:18, Paolo Bonzini wrote:
> On 20/09/2017 13:46, Alexey Kardashevskiy wrote:
>> + QTAILQ_FOREACH(as, &address_spaces, address_spaces_link) {
>> + MemoryRegion *physmr = memory_region_get_flatview_root(as->root);
>> + FlatView *new_view = g_hash_table_lookup(flat_views, physmr);
>> +
>> + if (new_view) {
>> + continue;
>> + }
>> +
>> + new_view = generate_memory_topology(physmr);
>> + g_hash_table_insert(flat_views, physmr, new_view);
>
> generate_memory_topology can do the g_hash_table_lookup + insert I think?
Yeah, I suppose. But rather g_hash_table_replace() if we decide to proceed
with 18/18 (or even if we do not - _replace() simply inserts if there was
no such element).
>> static void flatview_set_to_address_space(AddressSpace *as)
>> {
>> - FlatView *old_view = address_space_get_flatview(as);
>> + FlatView *old_view = address_space_to_flatview(as);
>> MemoryRegion *physmr = memory_region_get_flatview_root(as->root);
>> FlatView *new_view = g_hash_table_lookup(flat_views, physmr);
>
> Rename to address_space_set_flatview?
Sure, why not :)
--
Alexey
- [Qemu-devel] [PATCH qemu v4 00/18] memory: Reduce memory use, Alexey Kardashevskiy, 2017/09/20
- [Qemu-devel] [PATCH qemu v4 01/18] exec: Explicitly export target AS from address_space_translate_internal, Alexey Kardashevskiy, 2017/09/20
- [Qemu-devel] [PATCH qemu v4 17/18] memory: Create FlatView directly, Alexey Kardashevskiy, 2017/09/20
- [Qemu-devel] [PATCH qemu v4 12/18] memory: Share FlatView's and dispatch trees between address spaces, Alexey Kardashevskiy, 2017/09/20
- [Qemu-devel] [PATCH qemu v4 13/18] memory: Do not allocate FlatView in address_space_init, Alexey Kardashevskiy, 2017/09/20
- [Qemu-devel] [PATCH qemu v4 06/18] memory: Switch memory from using AddressSpace to FlatView, Alexey Kardashevskiy, 2017/09/20
- [Qemu-devel] [PATCH qemu v4 15/18] memory: Share special empty FlatView, Alexey Kardashevskiy, 2017/09/20
- [Qemu-devel] [PATCH qemu v4 02/18] memory: Open code FlatView rendering, Alexey Kardashevskiy, 2017/09/20
- [Qemu-devel] [PATCH qemu v4 10/18] memory: Alloc dispatch tree where topology is generared, Alexey Kardashevskiy, 2017/09/20
- [Qemu-devel] [PATCH qemu v4 08/18] memory: Rename mem_begin/mem_commit/mem_add helpers, Alexey Kardashevskiy, 2017/09/20
- [Qemu-devel] [PATCH qemu v4 09/18] memory: Store physical root MR in FlatView, Alexey Kardashevskiy, 2017/09/20