linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Marco Elver <elver@google.com>
To: Oscar Salvador <osalvador@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,  linux-mm@kvack.org,
	Michal Hocko <mhocko@suse.com>, Vlastimil Babka <vbabka@suse.cz>,
	 Andrey Konovalov <andreyknvl@gmail.com>,
	Alexander Potapenko <glider@google.com>
Subject: Re: [PATCH v8 5/5] mm,page_owner: Update Documentation regarding page_owner_stacks
Date: Tue, 13 Feb 2024 09:45:28 +0100	[thread overview]
Message-ID: <CANpmjNMaUHMNmA7CxZkGUsJ7LCmz+PGqYAzTKxq=u_Osu8Y4sA@mail.gmail.com> (raw)
In-Reply-To: <20240212223029.30769-6-osalvador@suse.de>

On Mon, 12 Feb 2024 at 23:29, Oscar Salvador <osalvador@suse.de> wrote:
>
> Update page_owner documentation including the new page_owner_stacks
> feature to show how it can be used.
>
> Signed-off-by: Oscar Salvador <osalvador@suse.de>
> ---
>  Documentation/mm/page_owner.rst | 44 +++++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
>
> diff --git a/Documentation/mm/page_owner.rst b/Documentation/mm/page_owner.rst
> index 62e3f7ab23cc..bcde81bf0902 100644
> --- a/Documentation/mm/page_owner.rst
> +++ b/Documentation/mm/page_owner.rst
> @@ -24,6 +24,11 @@ fragmentation statistics can be obtained through gfp flag information of
>  each page. It is already implemented and activated if page owner is
>  enabled. Other usages are more than welcome.
>
> +It can also be used to show all the stacks and their outstanding
> +allocations, which gives us a quick overview of where the memory is going
> +without the need to screen through all the pages and match the allocation
> +and free operation.
> +
>  page owner is disabled by default. So, if you'd like to use it, you need
>  to add "page_owner=on" to your boot cmdline. If the kernel is built
>  with page owner and page owner is disabled in runtime due to not enabling
> @@ -68,6 +73,45 @@ Usage
>
>  4) Analyze information from page owner::
>
> +       cat /sys/kernel/debug/page_owner_stacks/show_stacks > stacks.txt
> +       cat stacks.txt
> +        prep_new_page+0xa9/0x120
> +        get_page_from_freelist+0x7e6/0x2140
> +        __alloc_pages+0x18a/0x370
> +        new_slab+0xc8/0x580
> +        ___slab_alloc+0x1f2/0xaf0
> +        __slab_alloc.isra.86+0x22/0x40
> +        kmem_cache_alloc+0x31b/0x350
> +        __khugepaged_enter+0x39/0x100
> +        dup_mmap+0x1c7/0x5ce
> +        copy_process+0x1afe/0x1c90
> +        kernel_clone+0x9a/0x3c0
> +        __do_sys_clone+0x66/0x90
> +        do_syscall_64+0x7f/0x160
> +        entry_SYSCALL_64_after_hwframe+0x6c/0x74
> +       stack_count: 234
> +       ...
> +       ...
> +       echo 7000 > /sys/kernel/debug/page_owner_stacks/set_threshold > stacks_7000.txt

I think this example command is wrong.


  reply	other threads:[~2024-02-13  8:46 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-12 22:30 [PATCH v8 0/5] page_owner: print stacks and their outstanding allocations Oscar Salvador
2024-02-12 22:30 ` [PATCH v8 1/5] lib/stackdepot: Move stack_record struct definition into the header Oscar Salvador
2024-02-13  8:26   ` Marco Elver
2024-02-13 11:12   ` Vlastimil Babka
2024-02-12 22:30 ` [PATCH v8 2/5] mm,page_owner: Implement the tracking of the stacks count Oscar Salvador
2024-02-13  8:30   ` Marco Elver
2024-02-13  9:16     ` Oscar Salvador
2024-02-13  9:16   ` Vlastimil Babka
2024-02-13  9:21     ` Marco Elver
2024-02-13 11:34       ` Vlastimil Babka
2024-02-13 12:40         ` Oscar Salvador
2024-02-13 12:58           ` Marco Elver
2024-02-13  9:46     ` Oscar Salvador
2024-02-13 13:42   ` Vlastimil Babka
2024-02-13 15:29     ` Oscar Salvador
2024-02-13 16:04       ` Oscar Salvador
2024-02-12 22:30 ` [PATCH v8 3/5] mm,page_owner: Display all stacks and their count Oscar Salvador
2024-02-13  8:38   ` Marco Elver
2024-02-13  9:19     ` Oscar Salvador
2024-02-13 14:25   ` Vlastimil Babka
2024-02-13 15:33     ` Oscar Salvador
2024-02-13 15:36       ` Vlastimil Babka
2024-02-12 22:30 ` [PATCH v8 4/5] mm,page_owner: Filter out stacks by a threshold Oscar Salvador
2024-02-13  8:41   ` Marco Elver
2024-02-13  8:44   ` Marco Elver
2024-02-13  9:21     ` Oscar Salvador
2024-02-13 14:56       ` Vlastimil Babka
2024-02-12 22:30 ` [PATCH v8 5/5] mm,page_owner: Update Documentation regarding page_owner_stacks Oscar Salvador
2024-02-13  8:45   ` Marco Elver [this message]
2024-02-13  9:13     ` Oscar Salvador

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='CANpmjNMaUHMNmA7CxZkGUsJ7LCmz+PGqYAzTKxq=u_Osu8Y4sA@mail.gmail.com' \
    --to=elver@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@gmail.com \
    --cc=glider@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=osalvador@suse.de \
    --cc=vbabka@suse.cz \
    /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