[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
- Re: [PATCH RFC 02/21] util: Include osdep.h first in util/mmap-alloc.c, (continued)
- [PATCH RFC 03/21] physmem: Add qemu_ram_is_hugetlb(), Peter Xu, 2023/01/17
- [PATCH RFC 04/21] madvise: Include linux/mman.h under linux-headers/, Peter Xu, 2023/01/17
- [PATCH RFC 05/21] madvise: Add QEMU_MADV_SPLIT, Peter Xu, 2023/01/17
- [PATCH RFC 06/21] madvise: Add QEMU_MADV_COLLAPSE, Peter Xu, 2023/01/17
- [PATCH RFC 07/21] ramblock: Cache file offset for file-backed ramblocks, Peter Xu, 2023/01/17
- [PATCH RFC 08/21] ramblock: Cache the length to do file mmap() on ramblocks, Peter Xu, 2023/01/17
- [PATCH RFC 01/21] update linux headers, Peter Xu, 2023/01/17