mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: xu xin <cgel.zte@gmail.com>
Cc: adobriyan@gmail.com, willy@infradead.org, bagasdotme@gmail.com,
	hughd@google.com, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	xu xin <xu.xin16@zte.com.cn>,
	Izik Eidus <izik.eidus@ravellosystems.com>,
	Alexey Dobriyan <adobriyan@gmail.com>
Subject: Re: [PATCH v5 0/2] ksm: count allocated rmap_items and update documentation
Date: Tue, 30 Aug 2022 17:38:36 -0700	[thread overview]
Message-ID: <20220830173836.4e1a2a75c5e9cfb61638722a@linux-foundation.org> (raw)
In-Reply-To: <20220830143731.299702-1-xu.xin16@zte.com.cn>

On Tue, 30 Aug 2022 14:37:31 +0000 xu xin <cgel.zte@gmail.com> wrote:

> KSM can save memory by merging identical pages, but also can consume
> additional memory, because it needs to generate rmap_items to save
> each scanned page's brief rmap information.
> 
> To determine how beneficial the ksm-policy (like madvise), they are using
> brings, so we add a new interface /proc/<pid>/ksm_stat for each process
> The value "ksm_rmap_items" in it indicates the total allocated ksm
> rmap_items of this process.

I can see the usefulness and the code change is very simple, so I'll
queue it for testing and shall see what other reviewers have to say.

It's useful that the per-process file is called "ksm_stat", because we
may with to add additional content to it in the future.  Because
concerns have been expressed (by Alexey) about the proliferation of
procfs files causing major memory use when something reads them all. 
Putting more things in the same procfs files will help avoid this.


      parent reply	other threads:[~2022-08-31  0:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-30 14:37 xu xin
2022-08-30 14:38 ` [PATCH v5 1/2] ksm: count allocated ksm rmap_items for each process xu xin
2022-08-30 14:40 ` [PATCH v5 2/2] ksm: add profit monitoring documentation xu xin
2022-08-31  0:38 ` Andrew Morton [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=20220830173836.4e1a2a75c5e9cfb61638722a@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=adobriyan@gmail.com \
    --cc=bagasdotme@gmail.com \
    --cc=cgel.zte@gmail.com \
    --cc=hughd@google.com \
    --cc=izik.eidus@ravellosystems.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    --cc=xu.xin16@zte.com.cn \
    /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

all inboxes | Powered by JetHome®