On 2023/01/10 15:56, Tao Liu wrote: > Patchset [1] introduces maple tree data structure for linux, and the > modification on mm subsystem. > > The main impact on crash utility, is the modification on vm_area_struct. > Patch [2][3] removed the rbtree and linked list iteration of > vm_area_struct, making it impossible for crash to iterate vma > in the traditional way. For example, we can observe the failing > of crash cmd vm/fuser on kernel which has integrated with patchset [1]. > > This patchset deals with the issue by porting and adapting > kernel's maple tree vma iteration code to crash utility. It has been > tested on linux-next-next-20220914 [4]. > > [1]: https://lore.kernel.org/all/20220906194824.2110408-1-Liam.Howlett@xxxxxxxxxx/ > [2]: https://github.com/oracle/linux-uek/commit/d19703645b80abe35dff1a88449d074b0b5b1bb1 > [3]: https://github.com/oracle/linux-uek/commit/91dee01f1ebb6b6587463b6ee6f7bbc4965f91d5 > [4]: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/snapshot/linux-next-next-20220914.tar.gz > > v1 -> v2: > > 1) Move xarray.h and maple_tree_vma.h into maple.h. > 2) Remove variable-length array for maple_tree.c. > 3) Add tree cmd and do_maple_tree() support for maple tree. > 4) Other small modifications. > > v2 -> v3: > > 1) Remove for_each_vma() macro, and all its dependence functions such as > mas_find(), and use mt_dump()(aka do_maple_tree_traverse()) as a way for > maple tree iteration instead. > 2) Make do_maple_tree_info and maple_tree_ops local variable instead of > global variable. > 3) Show only valid maple entries by tree cmd. > 4) Remove empty structures, such as maple_tree{}/maple_metadata{}, use void * > instead. > 5) Other changes based on Kazu and Lianbo's comments. > > v3 -> v4: > > 1) Rename maple_tree/node_struct to maple_tree/node. > 2) Use ULONG(ptr) to replace *(unsigned long *)ptr. > 3) Replace void * with ulong. > 4) Add maple tree examples to help_tree EXAMPLES section. > 5) Remove unused maple_tree_mt variable to simplify do_mt_entry(), do_mt_node() > and do_mt_range64() functions. > 6) Removed unused radix variable of maple_tree_ops. > 7) Rebase the code to the latest in upstream. > > v4 -> v5: > > 1) Several formatting/wrapping/renaming issues suggested by Kazu. > 2) Replace cases as *((void **)(buf + OFFSET(xx)) + i) to > VOID_PTR(buf + OFFSET(xx) + sizeof(void *) * i) I've made several small comments, but they and others can be fixed when merging, so no need to resend for them. I think we can go with this. Thank you for the huge and hard work! Acked-by: Kazuhito Hagio <k-hagio-ab@xxxxxxx> > > Tao Liu (6): > Port the maple tree data structures and main functions > Add tree cmd support for maple tree > Add do_maple_tree support for maple tree > Introduce maple tree vma iteration to memory.c > Update the maple tree help info for tree cmd > Dump maple tree offset variables by help -o > > Makefile | 12 +- > defs.h | 26 +++ > help.c | 86 ++++++-- > maple_tree.c | 613 +++++++++++++++++++++++++++++++++++++++++++++++++++ > maple_tree.h | 82 +++++++ > memory.c | 321 ++++++++++++++++----------- > symbols.c | 17 ++ > tools.c | 67 ++++-- > 8 files changed, 1052 insertions(+), 172 deletions(-) > create mode 100644 maple_tree.c > create mode 100644 maple_tree.h > -- Crash-utility mailing list Crash-utility@xxxxxxxxxx https://listman.redhat.com/mailman/listinfo/crash-utility Contribution Guidelines: https://github.com/crash-utility/crash/wiki