lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 24 Aug 2022 12:52:31 +0000
From:   CGEL <cgel.zte@...il.com>
To:     Bagas Sanjaya <bagasdotme@...il.com>
Cc:     akpm@...ux-foundation.org, corbet@....net, adobriyan@...il.com,
        willy@...radead.org, hughd@...gle.com,
        linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-mm@...ck.org, linux-doc@...r.kernel.org,
        xu xin <xu.xin16@....com.cn>,
        Xiaokai Ran <ran.xiaokai@....com.cn>,
        Yang Yang <yang.yang29@....com.cn>
Subject: Re: [PATCH v3 2/2] ksm: add profit monitoring documentation

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ