qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH RFC 06/21] madvise: Add QEMU_MADV_COLLAPSE


From: Dr. David Alan Gilbert
Subject: Re: [PATCH RFC 06/21] madvise: Add QEMU_MADV_COLLAPSE
Date: Wed, 18 Jan 2023 18:51:07 +0000
User-agent: Mutt/2.2.9 (2022-11-12)

* Peter Xu (peterx@redhat.com) wrote:
> MADV_COLLAPSE is a new madvise() on Linux.  Define it.

I'd probably have merged this with the MADV_SPLIT one since they go
together; but also, it would be good in the commit message
for Qemu to include either the definition or a pointer to the kernel
definiton of them.

Dave

> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>  include/qemu/madvise.h | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/include/qemu/madvise.h b/include/qemu/madvise.h
> index 3dddd25065..794e5fb0a7 100644
> --- a/include/qemu/madvise.h
> +++ b/include/qemu/madvise.h
> @@ -68,6 +68,11 @@
>  #else
>  #define QEMU_MADV_SPLIT QEMU_MADV_INVALID
>  #endif
> +#ifdef MADV_COLLAPSE
> +#define QEMU_MADV_COLLAPSE MADV_COLLAPSE
> +#else
> +#define QEMU_MADV_COLLAPSE QEMU_MADV_INVALID
> +#endif
>  
>  #elif defined(CONFIG_POSIX_MADVISE)
>  
> @@ -83,6 +88,7 @@
>  #define QEMU_MADV_REMOVE QEMU_MADV_DONTNEED
>  #define QEMU_MADV_POPULATE_WRITE QEMU_MADV_INVALID
>  #define QEMU_MADV_SPLIT QEMU_MADV_INVALID
> +#define QEMU_MADV_COLLAPSE QEMU_MADV_INVALID
>  
>  #else /* no-op */
>  
> @@ -98,6 +104,7 @@
>  #define QEMU_MADV_REMOVE QEMU_MADV_INVALID
>  #define QEMU_MADV_POPULATE_WRITE QEMU_MADV_INVALID
>  #define QEMU_MADV_SPLIT QEMU_MADV_INVALID
> +#define QEMU_MADV_COLLAPSE QEMU_MADV_INVALID
>  
>  #endif
>  
> -- 
> 2.37.3
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK




reply via email to

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