Re: [PATCH v1 09/13] util/mmap-alloc: Implement resizable mmaps

2020-02-10 Thread David Hildenbrand
>> /* we can only map whole pages */ >> -size = QEMU_ALIGN_UP(size, pagesize); >> +old_size = QEMU_ALIGN_UP(old_size, pagesize); >> +new_size = QEMU_ALIGN_UP(new_size, pagesize); > > Shouldn't we just assert old_size and new_size are aligned with > pagesize? > Already reworked :

Re: [PATCH v1 09/13] util/mmap-alloc: Implement resizable mmaps

2020-02-06 Thread Murilo Opsfelder Araújo
Hello, David. On Monday, February 3, 2020 3:31:21 PM -03 David Hildenbrand wrote: > Implement resizable mmaps. For now, the actual resizing is not wired up. > Introduce qemu_ram_mmap_resizable() and qemu_ram_mmap_resize(). Make > qemu_ram_mmap() a wrapper of qemu_ram_mmap_resizable(). > > Cc: "Mic

Re: [PATCH v1 09/13] util/mmap-alloc: Implement resizable mmaps

2020-02-06 Thread David Hildenbrand
On 06.02.20 14:22, David Hildenbrand wrote: > On 06.02.20 13:08, Richard Henderson wrote: >> On 2/3/20 6:31 PM, David Hildenbrand wrote: >>> +void *qemu_ram_mmap_resize(void *ptr, int fd, size_t old_size, size_t >>> new_size, >>> + bool shared, bool is_pmem) >>> { >>>

Re: [PATCH v1 09/13] util/mmap-alloc: Implement resizable mmaps

2020-02-06 Thread David Hildenbrand
On 06.02.20 13:08, Richard Henderson wrote: > On 2/3/20 6:31 PM, David Hildenbrand wrote: >> +void *qemu_ram_mmap_resize(void *ptr, int fd, size_t old_size, size_t >> new_size, >> + bool shared, bool is_pmem) >> { >> const size_t pagesize = mmap_pagesize(fd); >> >

Re: [PATCH v1 09/13] util/mmap-alloc: Implement resizable mmaps

2020-02-06 Thread Richard Henderson
On 2/3/20 6:31 PM, David Hildenbrand wrote: > +void *qemu_ram_mmap_resize(void *ptr, int fd, size_t old_size, size_t > new_size, > + bool shared, bool is_pmem) > { > const size_t pagesize = mmap_pagesize(fd); > > /* we can only map whole pages */ > -size

[PATCH v1 09/13] util/mmap-alloc: Implement resizable mmaps

2020-02-03 Thread David Hildenbrand
Implement resizable mmaps. For now, the actual resizing is not wired up. Introduce qemu_ram_mmap_resizable() and qemu_ram_mmap_resize(). Make qemu_ram_mmap() a wrapper of qemu_ram_mmap_resizable(). Cc: "Michael S. Tsirkin" Cc: Greg Kurz Cc: Murilo Opsfelder Araujo Cc: Eduardo Habkost Cc: "Dr.