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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 15 Aug 2023 09:26:43 +0200
From:   David Hildenbrand <david@...hat.com>
To:     Stefan Roesch <shr@...kernel.io>, kernel-team@...com
Cc:     akpm@...ux-foundation.org, hannes@...xchg.org, riel@...riel.com,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linux-doc@...r.kernel.org
Subject: Re: [PATCH v1] mm/ksm: add pages scanned metric

On 11.08.23 21:36, Stefan Roesch wrote:
> ksm currently maintains several statistics, which let you determine how
> successful KSM is at sharing pages. However it does not contain a metric
> to determine how much work it does.
> 
> This commit adds the pages scanned metric. This allows the administrator
> to determine how many pages have been scanned over a period of time.
> 
> Signed-off-by: Stefan Roesch <shr@...kernel.io>
> ---
>   Documentation/admin-guide/mm/ksm.rst |  2 ++
>   mm/ksm.c                             | 16 +++++++++++++++-
>   2 files changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst
> index 5c5be7bd84b8..776f244bdae4 100644
> --- a/Documentation/admin-guide/mm/ksm.rst
> +++ b/Documentation/admin-guide/mm/ksm.rst
> @@ -159,6 +159,8 @@ The effectiveness of KSM and MADV_MERGEABLE is shown in ``/sys/kernel/mm/ksm/``:
>   
>   general_profit
>           how effective is KSM. The calculation is explained below.
> +pages_scanned
> +        how many pages are being scanned for ksm
>   pages_shared
>           how many shared pages are being used
>   pages_sharing
> diff --git a/mm/ksm.c b/mm/ksm.c
> index 6b7b8928fb96..8d6aee05421d 100644
> --- a/mm/ksm.c
> +++ b/mm/ksm.c
> @@ -242,6 +242,9 @@ static struct kmem_cache *rmap_item_cache;
>   static struct kmem_cache *stable_node_cache;
>   static struct kmem_cache *mm_slot_cache;
>   
> +/* The number of pages scanned */
> +static unsigned long ksm_pages_scanned;
> +

LGTM

Acked-by: David Hildenbrand <david@...hat.com>

-- 
Cheers,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ