|
From: | David Hildenbrand |
Subject: | Re: [PATCH v1 7/9] memory: introduce RAM_NORESERVE and wire it up in qemu_ram_mmap() |
Date: | Tue, 2 Mar 2021 21:58:46 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 |
On 02.03.21 21:54, Peter Xu wrote:
On Tue, Mar 02, 2021 at 08:02:34PM +0100, David Hildenbrand wrote:@@ -174,12 +175,18 @@ void *qemu_ram_mmap(int fd, size_t align, bool readonly, bool shared, - bool is_pmem) + bool is_pmem, + bool noreserve)Maybe at some point we should use flags too here to cover all bools.Right. I guess the main point was to not reuse RAM_XXX. Should I introduce RAM_MMAP_XXX ?Maybe we can directly use MAP_*? Since I see qemu_ram_mmap() should only exist
I think the issue is that there is for example no flag that corresponds to "is_pmem" - and the fallback logic in our mmap code to make "is_pmem" still work is a little bit more involved. In addition, "readonly" translates to PROT_READ ...
with CONFIG_POSIX. However indeed I see no sign to extend more bools in the near future either, so maybe also fine to keep it as is, as 4 bools still looks okay - your call. :)
Well, I had the same idea when I added yet another bool :) But I guess we won't be adding a lot of additional flags in the near future. (MAP_POPULATE? ;) fortunately we use a different approach to populate memory)
I'll think about it, not sure yet if this is worth proper flags. Thanks! -- Thanks, David / dhildenb
[Prev in Thread] | Current Thread | [Next in Thread] |