[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 12/15] util: vfio-helpers: Implement ram_block_resized()
From: |
Peter Xu |
Subject: |
Re: [PATCH v3 12/15] util: vfio-helpers: Implement ram_block_resized() |
Date: |
Fri, 28 Feb 2020 16:01:52 -0500 |
On Fri, Feb 28, 2020 at 09:16:28PM +0100, David Hildenbrand wrote:
>
[...]
> >> @@ -631,7 +658,7 @@ int qemu_vfio_dma_map(QEMUVFIOState *s, void *host,
> >> size_t size,
> >> qemu_vfio_remove_mapping(s, mapping);
> >> goto out;
> >> }
> >> - s->low_water_mark += size;
> >> + s->low_water_mark += max_size;
> >
> > I think it's fine to only increase the low water mark here, however
> > imo it would be better to also cache the max size in IOVAMapping too,
> > then in resize() we double check new_size <= max_size? It also makes
> > IOVAMapping more self contained.
> >
>
> I‘ll have a look how much additional code that will imply - if it‘s simple,
> I‘ll do it.
AFAICT it'll be as simple as introducing IOVAMapping.max_size, then
pass max_size into qemu_vfio_add_mapping(). Thanks,
--
Peter Xu
- [PATCH v3 07/15] util/mmap-alloc: Factor out calculation of the pagesize for the guard page, (continued)
- [PATCH v3 07/15] util/mmap-alloc: Factor out calculation of the pagesize for the guard page, David Hildenbrand, 2020/02/27
- [PATCH v3 08/15] util/mmap-alloc: Factor out reserving of a memory region to mmap_reserve(), David Hildenbrand, 2020/02/27
- [PATCH v3 09/15] util/mmap-alloc: Factor out populating of memory to mmap_populate(), David Hildenbrand, 2020/02/27
- [PATCH v3 10/15] util/mmap-alloc: Prepare for resizeable mmaps, David Hildenbrand, 2020/02/27
- [PATCH v3 11/15] util/mmap-alloc: Implement resizeable mmaps, David Hildenbrand, 2020/02/27
- [PATCH v3 12/15] util: vfio-helpers: Implement ram_block_resized(), David Hildenbrand, 2020/02/27
- Re: [PATCH v3 12/15] util: vfio-helpers: Implement ram_block_resized(), Peter Xu, 2020/02/28
[PATCH v3 13/15] util: oslib: Resizeable anonymous allocations under POSIX, David Hildenbrand, 2020/02/27
[PATCH v3 15/15] exec: Ram blocks with resizeable anonymous allocations under POSIX, David Hildenbrand, 2020/02/27
[PATCH v3 14/15] numa: Introduce ram_block_notifiers_support_resize(), David Hildenbrand, 2020/02/27