From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: lsf-pc@lists.linux-foundation.org
Cc: linux-mm <linux-mm@kvack.org>
Subject: [LSF/MM/BPF TOPIC] Improve KSM for code patching use-cases
Date: Tue, 28 Jan 2025 10:22:59 -0500 [thread overview]
Message-ID: <427ca05b-fe39-4365-83c6-a23a0733ee69@efficios.com> (raw)
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.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
next reply other threads:[~2025-01-28 15:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-28 15:22 Mathieu Desnoyers [this message]
2025-04-08 14:30 ` Mathieu Desnoyers
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=427ca05b-fe39-4365-83c6-a23a0733ee69@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