From: Oleksandr Natalenko <oleksandr@redhat.com>
To: Timofey Titovets <nefelim4ag@gmail.com>
Cc: Kirill Tkhai <ktkhai@virtuozzo.com>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Vlastimil Babka <vbabka@suse.cz>, Michal Hocko <mhocko@suse.com>,
Matthew Wilcox <willy@infradead.org>,
Pavel Tatashin <pasha.tatashin@soleen.com>,
Aaron Tomlin <atomlin@redhat.com>,
linux-mm@kvack.org
Subject: Re: [PATCH RFC 0/4] mm/ksm: add option to automerge VMAs
Date: Mon, 13 May 2019 14:06:31 +0200 [thread overview]
Message-ID: <20190513120631.cm2mc5grkofvloyk@butterfly.localdomain> (raw)
In-Reply-To: <20190513120117.aeiij4v2ncu43yxt@butterfly.localdomain>
On Mon, May 13, 2019 at 02:01:17PM +0200, Oleksandr Natalenko wrote:
> On Mon, May 13, 2019 at 02:48:29PM +0300, Timofey Titovets wrote:
> > > Also, just for the sake of another piece of stats here:
> > >
> > > $ echo "$(cat /sys/kernel/mm/ksm/pages_sharing) * 4 / 1024" | bc
> > > 526
> >
> > IIRC, for calculate saving you must use (pages_shared - pages_sharing)
>
> Based on Documentation/ABI/testing/sysfs-kernel-mm-ksm:
>
> pages_shared: how many shared pages are being used.
>
> pages_sharing: how many more sites are sharing them i.e. how
> much saved.
>
> and unless I'm missing something, this must be already accounted:
>
> [~]$ echo "$(cat /sys/kernel/mm/ksm/pages_shared) * 4 / 1024" | bc
> 69
>
> [~]$ echo "$(cat /sys/kernel/mm/ksm/pages_sharing) * 4 / 1024" | bc
> 563
Yup. To expand on this,
246 /* The number of nodes in the stable tree */
247 static unsigned long ksm_pages_shared;
248
249 /* The number of page slots additionally sharing those nodes */
250 static unsigned long ksm_pages_sharing;
2037 if (rmap_item->hlist.next)
2038 ksm_pages_sharing++;
2039 else
2040 ksm_pages_shared++;
IOW, first item is accounter in "shared", the rest will go to "sharing".
--
Best regards,
Oleksandr Natalenko (post-factum)
Senior Software Maintenance Engineer
next prev parent reply other threads:[~2019-05-13 12:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-10 7:21 Oleksandr Natalenko
2019-05-10 7:21 ` [PATCH RFC 1/4] mm/ksm: introduce ksm_enter() helper Oleksandr Natalenko
2019-05-10 7:21 ` [PATCH RFC 2/4] mm/ksm: introduce VM_UNMERGEABLE Oleksandr Natalenko
2019-05-10 7:21 ` [PATCH RFC 3/4] mm/ksm: allow anonymous memory automerging Oleksandr Natalenko
2019-05-10 7:21 ` [PATCH RFC 4/4] mm/ksm: add automerging documentation Oleksandr Natalenko
2019-05-13 10:38 ` [PATCH RFC 0/4] mm/ksm: add option to automerge VMAs Kirill Tkhai
2019-05-13 11:33 ` Oleksandr Natalenko
2019-05-13 11:48 ` Timofey Titovets
2019-05-13 12:01 ` Oleksandr Natalenko
2019-05-13 12:06 ` Oleksandr Natalenko [this message]
2019-05-13 12:37 ` Kirill Tkhai
2019-05-14 6:30 ` Oleksandr Natalenko
2019-05-14 9:12 ` Kirill Tkhai
2019-05-14 13:33 ` Oleksandr Natalenko
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=20190513120631.cm2mc5grkofvloyk@butterfly.localdomain \
--to=oleksandr@redhat.com \
--cc=atomlin@redhat.com \
--cc=ktkhai@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--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