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].

Patch 1: the pure copy-and-paste work, extracting related kernel
         structures, functions, constants to crash.
Patch 2: minimal code modification for crash adaption, kernel
         structures are kept for member resolving. 
Patch 3: modification on crash memory.c to use the maple vma
         iteration.

The idea is to make patch 1-3 a POC work.

Patch 4: Get rid of kernel structures by rewriting the structure
         member resolving code into the crash way, aka change
         "node->member" into "readmem(node) and OFFSET(member)"
Patch 5: print the added variables of offset/size table  
Patch 6: Get rid of the compiling-time assgined arrays.

Patch 4-6 will make the POC work formal for use.


[1]: 
https://lore.kernel.org/all/20220906194824.2110408-1-liam.howl...@oracle.com/
[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

Tao Liu (6):
  Port linux maple tree related files to crash
  Maple tree kernel code modification for step 1
  Introduce maple tree vma iteration to memory.c
  Maple tree kernel code modification for step 2
  Dump maple tree offset variables by help -o
  Remove mt_slots and mt_pivots array assignment

 Makefile         |  12 +-
 defs.h           |  19 ++
 maple_tree.c     | 824 +++++++++++++++++++++++++++++++++++++++++++++++
 maple_tree.h     | 109 +++++++
 maple_tree_vma.h |  34 ++
 memory.c         | 315 ++++++++++--------
 symbols.c        |  34 ++
 xarray.h         |  70 ++++
 8 files changed, 1285 insertions(+), 132 deletions(-)
 create mode 100644 maple_tree.c
 create mode 100644 maple_tree.h
 create mode 100644 maple_tree_vma.h
 create mode 100644 xarray.h

-- 
2.33.1

--
Crash-utility mailing list
Crash-utility@redhat.com
https://listman.redhat.com/mailman/listinfo/crash-utility
Contribution Guidelines: https://github.com/crash-utility/crash/wiki

Reply via email to