[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190513120631.cm2mc5grkofvloyk@butterfly.localdomain>
Date: Mon, 13 May 2019 14:06:31 +0200
From: Oleksandr Natalenko <oleksandr@...hat.com>
To: Timofey Titovets <nefelim4ag@...il.com>
Cc: Kirill Tkhai <ktkhai@...tuozzo.com>,
Linux Kernel <linux-kernel@...r.kernel.org>,
Vlastimil Babka <vbabka@...e.cz>,
Michal Hocko <mhocko@...e.com>,
Matthew Wilcox <willy@...radead.org>,
Pavel Tatashin <pasha.tatashin@...een.com>,
Aaron Tomlin <atomlin@...hat.com>, linux-mm@...ck.org
Subject: Re: [PATCH RFC 0/4] mm/ksm: add option to automerge VMAs
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
Powered by blists - more mailing lists