[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 fixed 11/16] util/mmap-alloc: Prepare for resizable mmaps
From: |
Peter Xu |
Subject: |
Re: [PATCH v2 fixed 11/16] util/mmap-alloc: Prepare for resizable mmaps |
Date: |
Wed, 19 Feb 2020 17:50:44 -0500 |
On Wed, Feb 12, 2020 at 02:42:49PM +0100, David Hildenbrand wrote:
> @@ -178,13 +183,15 @@ void *qemu_ram_mmap(int fd,
> size_t offset, total;
> void *ptr, *guardptr;
>
> + g_assert(QEMU_IS_ALIGNED(size, pagesize));
(NOTE: assertion is fine, but as I mentioned in previous patch, I
think this pagesize could not be the real one that's going to be
mapped...)
> +
> /*
> * Note: this always allocates at least one extra page of virtual address
> * space, even if size is already aligned.
> */
> total = size + align;
>
> - guardptr = mmap_reserve(total, fd);
> + guardptr = mmap_reserve(0, total, fd);
s/0/NULL/
Reviewed-by: Peter Xu <address@hidden>
--
Peter Xu
- [PATCH v2 fixed 08/16] util/mmap-alloc: Factor out calculation of pagesize to mmap_pagesize(), (continued)
- [PATCH v2 fixed 09/16] util/mmap-alloc: Factor out reserving of a memory region to mmap_reserve(), David Hildenbrand, 2020/02/12
- [PATCH v2 fixed 10/16] util/mmap-alloc: Factor out populating of memory to mmap_populate(), David Hildenbrand, 2020/02/12
- [PATCH v2 fixed 11/16] util/mmap-alloc: Prepare for resizable mmaps, David Hildenbrand, 2020/02/12
- Re: [PATCH v2 fixed 11/16] util/mmap-alloc: Prepare for resizable mmaps,
Peter Xu <=
- [PATCH v2 fixed 12/16] util/mmap-alloc: Implement resizable mmaps, David Hildenbrand, 2020/02/12
- [PATCH v2 fixed 13/16] numa: Teach ram block notifiers about resizable ram blocks, David Hildenbrand, 2020/02/12
- [PATCH v2 fixed 14/16] util: vfio-helpers: Implement ram_block_resized(), David Hildenbrand, 2020/02/12
- [PATCH v2 fixed 15/16] util: oslib: Resizable anonymous allocations under POSIX, David Hildenbrand, 2020/02/12
- [PATCH v2 fixed 16/16] exec: Ram blocks with resizable anonymous allocations under POSIX, David Hildenbrand, 2020/02/12
- Re: [PATCH v2 fixed 00/16] Ram blocks with resizable anonymous allocations under POSIX, David Hildenbrand, 2020/02/12