All of lore.kernel.org
 help / color / mirror / Atom feed
From: CGEL <cgel.zte@gmail.com>
To: Bagas Sanjaya <bagasdotme@gmail.com>
Cc: akpm@linux-foundation.org, corbet@lwn.net, adobriyan@gmail.com,
	willy@infradead.org, hughd@google.com,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org, linux-doc@vger.kernel.org,
	xu xin <xu.xin16@zte.com.cn>,
	Xiaokai Ran <ran.xiaokai@zte.com.cn>,
	Yang Yang <yang.yang29@zte.com.cn>
Subject: Re: [PATCH v3 2/2] ksm: add profit monitoring documentation
Date: Wed, 24 Aug 2022 12:52:31 +0000	[thread overview]
Message-ID: <63061f10.a70a0220.a807f.203f@mx.google.com> (raw)
In-Reply-To: <YwXxkqTM66aO1Y9l@debian.me>

On Wed, Aug 24, 2022 at 04:38:26PM +0700, Bagas Sanjaya wrote:
> On Wed, Aug 24, 2022 at 07:08:21AM +0000, xu xin wrote:
> > +1) How to determine whether KSM save memory or consume memory in system-wide
> > +range? Here is a simple approximate calculation for reference:
> > +
> > +	general_profit =~ pages_sharing * sizeof(page) - (all_rmap_items) *
> > +	         sizeof(rmap_item);
> > +
> > +where all_rmap_items can be easily obtained by summing ``pages_sharing``,
> > +``pages_shared``, ``pages_unshared`` and ``pages_volatile``.
> > +
> > +2) The KSM profit inner a single process can be similarly obtained by the
> > +following approximate calculation:
> > +
> > +	process_profit =~ ksm_merging_sharing * sizeof(page) -
> > +			  ksm_rmp_items * sizeof(rmap_item).
> > +
> 
> The profit formula above can be put into code blocks. Also, align the
> numbered list texts, like:

Thank you for corrections, done.

> 
> ---- >8 ----
> 
> diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst
> index 40bc11f6fa15fa..7e3092fe407e37 100644
> --- a/Documentation/admin-guide/mm/ksm.rst
> +++ b/Documentation/admin-guide/mm/ksm.rst
> @@ -194,22 +194,22 @@ be merged, but some may not be abled to be merged after being checked
>  several times, which are unprofitable memory consumed.
>  
>  1) How to determine whether KSM save memory or consume memory in system-wide
> -range? Here is a simple approximate calculation for reference:
> +   range? Here is a simple approximate calculation for reference::
>  
>  	general_profit =~ pages_sharing * sizeof(page) - (all_rmap_items) *
>  	         sizeof(rmap_item);
>  
> -where all_rmap_items can be easily obtained by summing ``pages_sharing``,
> -``pages_shared``, ``pages_unshared`` and ``pages_volatile``.
> +   where all_rmap_items can be easily obtained by summing ``pages_sharing``,
> +   ``pages_shared``, ``pages_unshared`` and ``pages_volatile``.
>  
>  2) The KSM profit inner a single process can be similarly obtained by the
> -following approximate calculation:
> +   following approximate calculation::
>  
>  	process_profit =~ ksm_merging_sharing * sizeof(page) -
>  			  ksm_rmp_items * sizeof(rmap_item).
>  
> -where both ksm_merging_sharing and ksm_rmp_items are shown under the directory
> -``/proc/<pid>/``.
> +   where both ksm_merging_sharing and ksm_rmp_items are shown under the
> +   directory ``/proc/<pid>/``.
>  
>  From the perspective of application, a high ratio of ``ksm_rmp_items`` to
>  ``ksm_merging_sharing`` means a bad madvise-applied policy, so developers or
> 
> Thanks.
> 
> -- 
> An old man doll... just what I always wanted! - Clara



      reply	other threads:[~2022-08-24 12:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24  7:05 [PATCH v3 0/2] ksm: count allocated rmap_items and update documentation xu xin
2022-08-24  7:07 ` [PATCH v3 1/2] ksm: count allocated ksm rmap_items for each process xu xin
2022-08-24  7:08 ` [PATCH v3 2/2] ksm: add profit monitoring documentation xu xin
2022-08-24  9:38   ` Bagas Sanjaya
2022-08-24 12:52     ` CGEL [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=63061f10.a70a0220.a807f.203f@mx.google.com \
    --to=cgel.zte@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bagasdotme@gmail.com \
    --cc=corbet@lwn.net \
    --cc=hughd@google.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ran.xiaokai@zte.com.cn \
    --cc=willy@infradead.org \
    --cc=xu.xin16@zte.com.cn \
    --cc=yang.yang29@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.