qemu-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]