Re: [PATCH v13] mm: report per-page metadata information

2024-08-05 Thread Pasha Tatashin
lps users precisely measure impact. Furthermore, page-metadata > > metrics will reflect the amount of struct pages reliquished > > (or overhead reduced) when hugetlbfs pages are reserved which > > will vary depending on whether hugetlb vmemmap optimization is > > enabled or no

Re: [PATCH v13] mm: report per-page metadata information

2024-08-06 Thread Pasha Tatashin
On Mon, Aug 5, 2024 at 7:06 PM Dan Williams wrote: > > Pasha Tatashin wrote: > [..] > > Thank you for the heads up. Can you please attach a full config file, > > also was anyone able to reproduce this problem in qemu with emulated > > nvdimm? > > Yes, I can repr

Re: [PATCH v13] mm: report per-page metadata information

2024-08-06 Thread Pasha Tatashin
On Tue, Aug 6, 2024 at 4:53 PM Ira Weiny wrote: > > On Tue, Aug 06, 2024 at 01:59:54PM -0400, Pasha Tatashin wrote: > > On Mon, Aug 5, 2024 at 7:06 PM Dan Williams > > wrote: > > > > > > Pasha Tatashin wrote: > > > [..] > > > > Thank

Re: [PATCH v13] mm: report per-page metadata information

2024-08-06 Thread Pasha Tatashin
On Tue, Aug 6, 2024 at 5:37 PM Pasha Tatashin wrote: > > On Tue, Aug 6, 2024 at 4:53 PM Ira Weiny wrote: > > > > On Tue, Aug 06, 2024 at 01:59:54PM -0400, Pasha Tatashin wrote: > > > On Mon, Aug 5, 2024 at 7:06 PM Dan Williams > > > wrote:

Re: [PATCH v4 1/6] maple_tree: add mas_for_each_rev() helper

2024-10-23 Thread Pasha Tatashin
On Wed, Oct 23, 2024 at 1:08 PM Suren Baghdasaryan wrote: > > Add mas_for_each_rev() function to iterate maple tree nodes in reverse > order. > > Suggested-by: Liam R. Howlett > Signed-off-by: Suren Baghdasaryan > Reviewed-by: Liam R. Howlett Reviewed-by: Pasha Tatash

Re: [PATCH v4 5/6] alloc_tag: introduce pgtag_ref_handle to abstract page tag references

2024-10-23 Thread Pasha Tatashin
On Wed, Oct 23, 2024 at 1:08 PM Suren Baghdasaryan wrote: > > To simplify later changes to page tag references, introduce new > pgtag_ref_handle type. This allows easy replacement of page_ext > as a storage of page allocation tags. > > Signed-off-by: Suren Baghdasaryan

Re: [PATCH v4 2/6] alloc_tag: introduce shutdown_mem_profiling helper function

2024-10-23 Thread Pasha Tatashin
t; > Signed-off-by: Suren Baghdasaryan Reviewed-by: Pasha Tatashin

Re: [PATCH v4 3/6] alloc_tag: load module tags into separate contiguous memory

2024-10-23 Thread Pasha Tatashin
r on > in this patchset. The size of this virtually contiguous memory is set > to store up to 10 allocation tags. > > Signed-off-by: Suren Baghdasaryan Reviewed-by: Pasha Tatashin > --- > include/asm-generic/codetag.lds.h | 19 +++ > include/linux/alloc_tag.h | 13 +-

Re: [PATCH v4 6/6] alloc_tag: support for page allocation tag compression

2024-10-23 Thread Pasha Tatashin
ificant improvement for the fleet users. Reviewed-by: Pasha Tatashin

Re: [PATCH v4 4/6] alloc_tag: populate memory for module tags as needed

2024-10-23 Thread Pasha Tatashin
t with physical pages as needed when we load a module. > > Signed-off-by: Suren Baghdasaryan Reviewed-by: Pasha Tatashin

[RFCv1 5/6] misc/page_detective: enable loadable module

2024-11-16 Thread Pasha Tatashin
Export the missing symbols, and allow page_detective to be built as a loadable module. This can be make this available in the field, where Page Detective is loaded only once it is needed. Signed-off-by: Pasha Tatashin --- drivers/misc/Kconfig | 2 +- fs/kernfs/dir.c | 1 + kernel/pid.c

[RFCv1 1/6] mm: Make get_vma_name() function public

2024-11-16 Thread Pasha Tatashin
Page Detective will be using get_vma_name() that is currently used by fs/proc to show names of VMAs in /proc//smaps for example. Move this function to mm/vma.c, and make it accessible by modules. Signed-off-by: Pasha Tatashin --- fs/proc/task_mmu.c | 61

[RFCv1 0/6] Page Detective

2024-11-16 Thread Pasha Tatashin
ernel log messages (can be accessed with dmesg), and includes information such as the page's reference count, mapping, flags, and memory cgroup. It also shows whether the page is mapped in the kernel page table, and if so, how many times. Pasha Tatashin (6): mm: Make get_vma_name() function p

[RFCv1 6/6] selftests/page_detective: Introduce self tests for Page Detective

2024-11-16 Thread Pasha Tatashin
Add self tests for Page Detective, it contains testing of several memory types, and also some negative/bad input tests. Signed-off-by: Pasha Tatashin --- MAINTAINERS | 1 + tools/testing/selftests/Makefile | 1 + .../selftests/page_detective

Re: [RFCv1 4/6] misc/page_detective: Introduce Page Detective

2024-11-18 Thread Pasha Tatashin
On Sat, Nov 16, 2024 at 5:20 PM Jonathan Corbet wrote: > > Pasha Tatashin writes: > > > Page Detective is a kernel debugging tool that provides detailed > > information about the usage and mapping of physical memory pages. > > > > It operates through the Linux de

Re: [RFCv1 2/6] pagewalk: Add a page table walker for init_mm page table

2024-11-18 Thread Pasha Tatashin
On Mon, Nov 18, 2024 at 1:49 AM Christoph Hellwig wrote: > > On Sat, Nov 16, 2024 at 05:59:18PM +, Pasha Tatashin wrote: > > } while (start = next, start < end); > > return err; > > } > > +EXPORT_SYMBOL_GPL(walk_page_range); > > Umm, no.

Re: [RFCv1 1/6] mm: Make get_vma_name() function public

2024-11-18 Thread Pasha Tatashin
On Mon, Nov 18, 2024 at 5:27 AM Lorenzo Stoakes wrote: > > On Sat, Nov 16, 2024 at 05:59:17PM +, Pasha Tatashin wrote: > > Page Detective will be using get_vma_name() that is currently used by > > fs/proc to show names of VMAs in /proc//smaps for example. > > >

Re: [RFCv1 6/6] selftests/page_detective: Introduce self tests for Page Detective

2024-11-18 Thread Pasha Tatashin
On Sun, Nov 17, 2024 at 1:25 AM Muhammad Usama Anjum wrote: > > On 11/16/24 10:59 PM, Pasha Tatashin wrote: > > Add self tests for Page Detective, it contains testing of several memory > > types, and also some negative/bad input tests. > > > >

Re: [RFCv1 1/6] mm: Make get_vma_name() function public

2024-11-18 Thread Pasha Tatashin
On Mon, Nov 18, 2024 at 3:44 PM Matthew Wilcox wrote: > > On Mon, Nov 18, 2024 at 03:40:57PM -0500, Pasha Tatashin wrote: > > > You're putting something in an mm/ C-file and the header in fs.h? Eh? > > > > This is done so we do not have to include struct path into

Re: [RFCv1 0/6] Page Detective

2024-11-18 Thread Pasha Tatashin
> Can you point me to where a refcounted reference to the page comes > from when page_detective_metadata() calls dump_page_lvl()? I am sorry, I remembered incorrectly, we are getting reference right after dump_page_lvl() in page_detective_memcg() -> folio_try_get(); I will move the folio_try_get()

Re: [RFCv1 0/6] Page Detective

2024-11-18 Thread Pasha Tatashin
On Mon, Nov 18, 2024 at 7:54 AM Jann Horn wrote: > > On Mon, Nov 18, 2024 at 12:17 PM Lorenzo Stoakes > wrote: > > On Sat, Nov 16, 2024 at 05:59:16PM +, Pasha Tatashin wrote: > > > It operates through the Linux debugfs interface, with two files: "virt" >

Re: [RFCv1 0/6] Page Detective

2024-11-18 Thread Pasha Tatashin
On Mon, Nov 18, 2024 at 2:11 PM Roman Gushchin wrote: > > On Sat, Nov 16, 2024 at 05:59:16PM +, Pasha Tatashin wrote: > > Page Detective is a new kernel debugging tool that provides detailed > > information about the usage and mapping of physical memory pages. > > >

Re: [RFCv1 0/6] Page Detective

2024-11-19 Thread Pasha Tatashin
On Tue, Nov 19, 2024 at 1:23 PM Roman Gushchin wrote: > > On Tue, Nov 19, 2024 at 10:08:36AM -0500, Pasha Tatashin wrote: > > On Mon, Nov 18, 2024 at 8:09 PM Greg KH wrote: > > > > > > On Mon, Nov 18, 2024 at 05:08:42PM -0500, Pasha Tatashin wrote: > > >

Re: [RFCv1 0/6] Page Detective

2024-11-19 Thread Pasha Tatashin
On Mon, Nov 18, 2024 at 8:09 PM Greg KH wrote: > > On Mon, Nov 18, 2024 at 05:08:42PM -0500, Pasha Tatashin wrote: > > Additionally, using crash/drgn is not feasible for us at this time, it > > requires keeping external tools on our hosts, also it requires > > approval a

Re: [RFCv1 0/6] Page Detective

2024-11-20 Thread Pasha Tatashin
> > /* Use static buffer, for the caller is holding oom_lock. */ > > static char buf[PAGE_SIZE]; > > > > seq_buf_init(&s, buf, sizeof(buf)); > > memory_stat_format(memcg, &s); > > seq_buf_do_printk(&s, KERN_INFO); > > } > > > > This is a callosal

Re: [RFCv1 0/6] Page Detective

2024-11-20 Thread Pasha Tatashin
On Tue, Nov 19, 2024 at 2:36 PM Yosry Ahmed wrote: > > On Tue, Nov 19, 2024 at 11:30 AM Pasha Tatashin > wrote: > > > > On Tue, Nov 19, 2024 at 1:23 PM Roman Gushchin > > wrote: > > > > > > On Tue, Nov 19, 2024 at 10:08:36AM -0500, Pasha Tatashin w

Re: [RFCv1 0/6] Page Detective

2024-11-20 Thread Pasha Tatashin
On Wed, Nov 20, 2024 at 10:29 AM Andi Kleen wrote: > > Pasha Tatashin writes: > > > Page Detective is a new kernel debugging tool that provides detailed > > information about the usage and mapping of physical memory pages. > > > > It is often known that a partic

Re: [RFCv1 0/6] Page Detective

2024-11-19 Thread Pasha Tatashin
On Tue, Nov 19, 2024 at 7:52 AM Jann Horn wrote: > > On Tue, Nov 19, 2024 at 2:30 AM Pasha Tatashin > wrote: > > > Can you point me to where a refcounted reference to the page comes > > > from when page_detective_metadata() calls dump_page_lvl()? > > > > I

[RFCv1 4/6] misc/page_detective: Introduce Page Detective

2024-11-16 Thread Pasha Tatashin
corruptions. Signed-off-by: Pasha Tatashin --- Documentation/misc-devices/index.rst | 1 + Documentation/misc-devices/page_detective.rst | 78 ++ MAINTAINERS | 7 + drivers/misc/Kconfig | 11 + drivers/misc/Makefile

[RFCv1 3/6] mm: Add a dump_page variant that accept log level argument

2024-11-16 Thread Pasha Tatashin
Page Detective uses info level, while dump_page() uses warn level. Add a new function dump_page_lvl() that accepts log level argument to be able to dump pages at specific level. Also, this enables adding a modules specific prefix to output of this function. Signed-off-by: Pasha Tatashin --- fs

[RFCv1 2/6] pagewalk: Add a page table walker for init_mm page table

2024-11-16 Thread Pasha Tatashin
Page Detective will use it to walk the kernel page table. Make this function accessible from modules, and also while here make walk_page_range() accessible from modules, so Page Detective could use it to walk user page tables. Signed-off-by: Pasha Tatashin --- include/linux/pagewalk.h | 2