[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 07/13] util/mmap-alloc: Factor out populating of memory to
From: |
David Hildenbrand |
Subject: |
Re: [PATCH v1 07/13] util/mmap-alloc: Factor out populating of memory to mmap_populate() |
Date: |
Thu, 6 Feb 2020 10:26:26 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 |
On 05.02.20 20:56, Murilo Opsfelder Araújo wrote:
> Hello, David.
>
> On 2/3/20 3:31 PM, David Hildenbrand wrote:
>> We want to populate memory within a reserved memory region. Let's factor
>> that out.
>>
>> Cc: "Michael S. Tsirkin" <address@hidden>
>> Cc: Greg Kurz <address@hidden>
>> Cc: Murilo Opsfelder Araujo <address@hidden>
>> Cc: Eduardo Habkost <address@hidden>
>> Cc: "Dr. David Alan Gilbert" <address@hidden>
>> Signed-off-by: David Hildenbrand <address@hidden>
>> ---
>
> Acked-by: Murilo Opsfelder Araujo <address@hidden>
>
> A minor comment below.
>
>> util/mmap-alloc.c | 89 +++++++++++++++++++++++++----------------------
>> 1 file changed, 47 insertions(+), 42 deletions(-)
>>
>> diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
>> index 43a26f38a8..f043ccb0ab 100644
>> --- a/util/mmap-alloc.c
>> +++ b/util/mmap-alloc.c
>> @@ -114,6 +114,50 @@ static void *mmap_reserve(size_t size, int fd)
>> return mmap(0, size, PROT_NONE, flags, fd, 0);
>> }
>>
>> +/*
>> + * Populate memory in a reserved region from the given fd (if any).
>> + */
>> +static void *mmap_populate(void *ptr, size_t size, int fd, bool shared,
>> + bool is_pmem)
>> +{
>> + int map_sync_flags = 0;
>> + int flags = MAP_FIXED;
>> + void *new_ptr;
>
> Do you think another name would be welcome here, e.g.: "populated_ptr" or
> "populated_memptr" or just "populated"?
I'll go with populated_ptr - thanks!
--
Thanks,
David / dhildenb
- [PATCH v1 01/13] util: vfio-helpers: Factor out and fix processing of existings ram blocks, (continued)
- [PATCH v1 01/13] util: vfio-helpers: Factor out and fix processing of existings ram blocks, David Hildenbrand, 2020/02/03
- [PATCH v1 03/13] exec: Reuse qemu_ram_apply_settings() in qemu_ram_remap(), David Hildenbrand, 2020/02/03
- [PATCH v1 04/13] exec: Drop "shared" parameter from ram_block_add(), David Hildenbrand, 2020/02/03
- [PATCH v1 05/13] util/mmap-alloc: Factor out calculation of pagesize to mmap_pagesize(), David Hildenbrand, 2020/02/03
- [PATCH v1 07/13] util/mmap-alloc: Factor out populating of memory to mmap_populate(), David Hildenbrand, 2020/02/03
- [PATCH v1 10/13] numa: Introduce ram_block_notify_resized() and ram_block_notifiers_support_resize(), David Hildenbrand, 2020/02/03
- [PATCH v1 09/13] util/mmap-alloc: Implement resizable mmaps, David Hildenbrand, 2020/02/03
- Re: [PATCH v1 09/13] util/mmap-alloc: Implement resizable mmaps, Murilo Opsfelder Araújo, 2020/02/06
- [PATCH v1 08/13] util/mmap-alloc: Prepare for resizable mmaps, David Hildenbrand, 2020/02/03