[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z8HlL4FopVjeveaJ@x1.local>
Date: Fri, 28 Feb 2025 11:32:47 -0500
From: Peter Xu <peterx@...hat.com>
To: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Matthew Wilcox <willy@...radead.org>,
Olivier Dion <odion@...icios.com>, linux-mm@...ck.org
Subject: Re: [RFC PATCH 0/2] SKSM: Synchronous Kernel Samepage Merging
On Fri, Feb 28, 2025 at 09:59:00AM -0500, Mathieu Desnoyers wrote:
> For the VM use-case, I wonder if we could just add a userfaultfd
> "COW" event that would notify userspace when a COW happens ?
I don't know what's the best for KSM and how well this will work, but we
have such event for years.. See UFFDIO_REGISTER_MODE_WP:
https://man7.org/linux/man-pages/man2/userfaultfd.2.html
>
> This would allow userspace to replace ksmd by tracking the age of
> those anonymous pages, and issue madvise MADV_MERGE on them to
> write-protect+merge them when it is deemed useful.
>
> With both a new userfaultfd COW event and madvise MADV_MERGE,
> is there anything else that is fundamentally missing to move
> all the scanning complexity of KSM to userspace for the VM
> deduplication use-case ?
Thanks,
--
Peter Xu
Powered by blists - more mailing lists