linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sourav Panda <souravpanda@google.com>
To: David Hildenbrand <david@redhat.com>
Cc: lsf-pc@lists.linux-foundation.org, Linux-MM <linux-mm@kvack.org>,
	 Pavel Tatashin <pasha.tatashin@soleen.com>,
	Yu Zhao <yuzhao@google.com>,
	shr@devkernel.io,  David Rientjes <rientjes@google.com>
Subject: Re: [LSF/MM/BPF TOPIC] KSM Enhancements: Selective KSM
Date: Tue, 4 Feb 2025 10:21:56 -0800	[thread overview]
Message-ID: <CANruzcQMCX5=9Wn_xPnKR3SYq+URO7gBos2D=SKgkcBtt9desQ@mail.gmail.com> (raw)
In-Reply-To: <aadb7746-6972-498e-b21d-ab9d0df59dd9@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1993 bytes --]

On Tue, Feb 4, 2025 at 1:44 AM David Hildenbrand <david@redhat.com> wrote:

> On 01.02.25 03:15, Sourav Panda wrote:
> > Hi,
>
> Hi,
>
> >
> >
> > KSM is a powerful tool for deduplicating memory, reducing usage by
> merging
> >
> > identical pages across processes. However, there are certain interface
> and
> >
> > implementation aspect that prevents its deployment in our use case;
> wherein
> >
> > security and efficiency (CPU overhead - due to background scanning) are
> of
> >
> > greater importance.
> >
> >
> > We propose Selective KSM, a mechanism to control when the merging takes
> >
> > place and what pages can be merged together. We do this by partitioning
> the
> >
> > merge-space as per security-domains and carryout the merging as part of a
> >
> > synchronous syscall. Doing so, we ensure sensitive-content is not merged
> >
> > with non-sensitive content.
>
> I'll note that there was an RFC for uKSM [1] last year. Unfortunately, I
> didn't have time to look into it in more detail, and there was never any
> push for it.
>

Thank you David. I took a look at it, one major callout would be it is
extremely fine grained wherein you specify the exact 2 pages you want to
have merged. I prefer triggering a merge at a coarser granularity wherein
you just specify the address range you want merged. Furthermore, are not
required to specify what to merge against in the same invocation (e.g.,
insert / search the unstable tree).


>
> In particular, it proposed an interface:
>
> - /proc/uksm/merge enables the merging of two pages given their process
>    IDs and addresses.
> - /proc/uksm/unmerge allows unmerging a previously merged KSM page.
> - /proc/uksm/cmp provides a lightweight mechanism to check page content
>    equivalence before invoking a merge operation.
>
> [1]
>
> https://lore.kernel.org/linux-mm/20240329104035.62942-1-teawater@antgroup.com/T/
>
> --
> Cheers,
>
> David / dhildenb
>
>

[-- Attachment #2: Type: text/html, Size: 2784 bytes --]

      reply	other threads:[~2025-02-04 18:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-01  2:15 Sourav Panda
2025-02-03  2:54 ` David Rientjes
2025-02-03  7:20   ` Sourav Panda
2025-02-04  9:44 ` David Hildenbrand
2025-02-04 18:21   ` Sourav Panda [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='CANruzcQMCX5=9Wn_xPnKR3SYq+URO7gBos2D=SKgkcBtt9desQ@mail.gmail.com' \
    --to=souravpanda@google.com \
    --cc=david@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=lsf-pc@lists.linux-foundation.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=rientjes@google.com \
    --cc=shr@devkernel.io \
    --cc=yuzhao@google.com \
    /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