qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 8/9] util/mmap-alloc: Support RAM_NORESERVE via MAP_NORESE


From: Peter Xu
Subject: Re: [PATCH v2 8/9] util/mmap-alloc: Support RAM_NORESERVE via MAP_NORESERVE
Date: Fri, 5 Mar 2021 10:42:06 -0500

On Fri, Mar 05, 2021 at 11:16:33AM +0100, David Hildenbrand wrote:
> +#define OVERCOMMIT_MEMORY_PATH "/proc/sys/vm/overcommit_memory"
> +static bool map_noreserve_effective(int fd, bool readonly, bool shared)
> +{

[...]

> @@ -184,8 +251,7 @@ void *qemu_ram_mmap(int fd,
>      size_t offset, total;
>      void *ptr, *guardptr;
>  
> -    if (noreserve) {
> -        error_report("Skipping reservation of swap space is not supported");
> +    if (noreserve && !map_noreserve_effective(fd, shared, readonly)) {

Need to switch "shared" & "readonly"?

>          return MAP_FAILED;
>      }

-- 
Peter Xu




reply via email to

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