linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Oleksandr Natalenko <oleksandr@redhat.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: linux-kernel@vger.kernel.org, Kirill Tkhai <ktkhai@virtuozzo.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	Matthew Wilcox <willy@infradead.org>,
	Pavel Tatashin <pasha.tatashin@soleen.com>,
	Timofey Titovets <nefelim4ag@gmail.com>,
	Aaron Tomlin <atomlin@redhat.com>,
	Grzegorz Halat <ghalat@redhat.com>,
	linux-mm@kvack.org, linux-api@vger.kernel.org,
	Hugh Dickins <hughd@google.com>
Subject: Re: [PATCH RFC v2 0/4] mm/ksm: add option to automerge VMAs
Date: Wed, 15 May 2019 09:37:23 +0200	[thread overview]
Message-ID: <20190515073723.wbr522cpyjfelfav@butterfly.localdomain> (raw)
In-Reply-To: <20190515065311.GB16651@dhcp22.suse.cz>

Hi.

On Wed, May 15, 2019 at 08:53:11AM +0200, Michal Hocko wrote:
> On Wed 15-05-19 08:25:23, Oleksandr Natalenko wrote:
> [...]
> > > > Please make sure to describe a usecase that warrants adding a new
> > > > interface we have to maintain for ever.
> > 
> > I think of two major consumers of this interface:
> > 
> > 1) hosts, that run containers, especially similar ones and especially in
> > a trusted environment;
> > 
> > 2) heavy applications, that can be run in multiple instances, not
> > limited to opensource ones like Firefox, but also those that cannot be
> > modified.
> 
> This is way too generic. Please provide something more specific. Ideally
> with numbers. Why those usecases cannot use an existing interfaces.
> Remember you are trying to add a new user interface which we will have
> to maintain for ever.

For my current setup with 2 Firefox instances I get 100 to 200 MiB saved
for the second instance depending on the amount of tabs.

1 FF instance with 15 tabs:

$ echo "$(cat /sys/kernel/mm/ksm/pages_sharing) * 4 / 1024" | bc
410

2 FF instances, second one has 12 tabs (all the tabs are different):

$ echo "$(cat /sys/kernel/mm/ksm/pages_sharing) * 4 / 1024" | bc
592

At the very moment I do not have specific numbers for containerised
workload, but those should be similar in case the containers share
similar/same runtime (like multiple Node.js containers etc).

Answering your question regarding using existing interfaces, since
there's only one, madvise(2), this requires modifying all the
applications one wants to de-duplicate. In case of containers with
arbitrary content or in case of binary-only apps this is pretty hard if
not impossible to do properly.

> I will try to comment on the interface itself later. But I have to say
> that I am not impressed. Abusing sysfs for per process features is quite
> gross to be honest.

Sure, please do.

Thanks for your time and inputs.

-- 
  Best regards,
    Oleksandr Natalenko (post-factum)
    Senior Software Maintenance Engineer


  reply	other threads:[~2019-05-15  7:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14 13:16 [PATCH RFC v2 0/4] mm/ksm: add option to automerge VMAs Oleksandr Natalenko
2019-05-14 13:16 ` [PATCH RFC v2 1/4] mm/ksm: introduce ksm_enter() helper Oleksandr Natalenko
2019-05-14 13:16 ` [PATCH RFC v2 2/4] mm/ksm: introduce ksm_leave() helper Oleksandr Natalenko
2019-05-14 13:16 ` [PATCH RFC v2 3/4] mm/ksm: introduce force_madvise knob Oleksandr Natalenko
2019-05-14 13:22   ` Aaron Tomlin
2019-05-15  0:48     ` Timofey Titovets
2019-05-14 13:16 ` [PATCH RFC v2 4/4] mm/ksm: add force merging/unmerging documentation Oleksandr Natalenko
2019-05-15  0:53   ` Timofey Titovets
2019-05-15  6:26     ` Oleksandr Natalenko
2019-05-14 14:41 ` [PATCH RFC v2 0/4] mm/ksm: add option to automerge VMAs Michal Hocko
2019-05-14 14:51   ` Michal Hocko
2019-05-15  6:25     ` Oleksandr Natalenko
2019-05-15  6:53       ` Michal Hocko
2019-05-15  7:37         ` Oleksandr Natalenko [this message]
2019-05-15  8:33           ` Michal Hocko
2019-05-15  8:51             ` Oleksandr Natalenko
2019-05-15 14:24               ` Michal Hocko
2019-05-15 14:51         ` Michal Hocko
2019-05-15 15:15           ` Greg KH
2019-05-16  7:47             ` Michal Hocko
2019-05-16  7:53               ` Greg KH

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=20190515073723.wbr522cpyjfelfav@butterfly.localdomain \
    --to=oleksandr@redhat.com \
    --cc=atomlin@redhat.com \
    --cc=ghalat@redhat.com \
    --cc=hughd@google.com \
    --cc=ktkhai@virtuozzo.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=nefelim4ag@gmail.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).