From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: lsf-pc@lists.linux-foundation.org
Cc: linux-mm <linux-mm@kvack.org>
Subject: Re: [LSF/MM/BPF TOPIC] Improve KSM for code patching use-cases
Date: Tue, 8 Apr 2025 10:30:45 -0400 [thread overview]
Message-ID: <a8096616-6ece-484e-94a7-a95e7be42f9e@efficios.com> (raw)
In-Reply-To: <427ca05b-fe39-4365-83c6-a23a0733ee69@efficios.com>
On 2025-01-28 10:22, Mathieu Desnoyers wrote:
> Hi,
>
> I submit this topic proposal for your consideration:
>
> We are implementing a code patching library which essentially
> reimplements static keys for userspace. (work in progress,
> not released yet)
>
> One of the problems we face when patching code from libraries
> and executables from nops to jumps is Copy-on-Write (CoW), which
> increases memory use and prevents sharing code pages across
> processes.
>
> I suspect we can improve Kernel Samepage Merging (KSM) to
> better handle scenarios where pages which are the result of
> a CoW from a given file/offset are modified shortly after
> their CoW, and then are stable for most of their lifetime.
>
> This would allow merging CoW pages when the resulting
> modification makes them identical again. This could be
> achieved by tracking possible duplicates on a per
> file/offset basis, which should be more efficient than
> a global scan.
>
> I would like to discuss this topic with Filesystem and MM
> experts to get their input.
Here are the slides I presented during my talk:
https://drive.google.com/file/d/18EkWsvILbPlTDRHI22sHIWUhlqBsYILy/view?usp=sharing
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
prev parent reply other threads:[~2025-04-08 14:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-28 15:22 Mathieu Desnoyers
2025-04-08 14:30 ` Mathieu Desnoyers [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a8096616-6ece-484e-94a7-a95e7be42f9e@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=linux-mm@kvack.org \
--cc=lsf-pc@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox