linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] page_owner: support filtering by module
@ 2023-08-15 12:52 Jinjiang Tu
  2023-08-15 12:52 ` [PATCH 1/6] mm/page_owner: support identifying pages allocated by modules Jinjiang Tu
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Jinjiang Tu @ 2023-08-15 12:52 UTC (permalink / raw)
  To: linux-mm, akpm, wangkefeng.wang, sunnanyong, liushixin2; +Cc: tujinjiang

page_owner is a debug tool to record who allocated/freed each
page. However, it fails to record which module allocated/freed the
pages. Generally, most memory leak bugs are caused by modules,
especially third-party modules. If page_owner supports recording
and filtering pages allocated by modules, it will help us much to
find such bugs.

In this patch, we identify the module that allocate each page by
traversing the stacktrace. The module name will be dumped by
page_owner interface. We also enhance the tool/mm/page_owner_sort
tool to filter the pages allocated by modules.

Besides, when oom occurrs, we fail to know pages are allocated by
which modules. It is too late to dump page_owner after oom occurrs.
Therefore, we records the number of pages allocated by each module,
and dump the modules when oom occurrs. It will help us to find
the buggy module.

Jinjiang Tu (6):
  mm/page_owner: support identifying pages allocated by modules
  mm/page_owner: show modules allocating pages when oom occurred
  tools/vm/page_owner_sort: support for selecting by module name
  tools/vm/page_owner_sort: support for culling by module name
  tools/vm/page_owner_sort: support sorting by module name
  Documentation: update document for page_owner

 Documentation/mm/page_owner.rst |  13 +++-
 include/linux/module.h          |   4 ++
 kernel/module/Makefile          |   1 +
 kernel/module/main.c            |   4 ++
 kernel/module/page_owner.c      |  38 ++++++++++++
 mm/page_owner.c                 |  96 +++++++++++++++++++++++++++++
 tools/mm/page_owner_sort.c      | 106 ++++++++++++++++++++++++++++----
 7 files changed, 248 insertions(+), 14 deletions(-)
 create mode 100644 kernel/module/page_owner.c

-- 
2.25.1



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-08-15 15:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-15 12:52 [PATCH 0/6] page_owner: support filtering by module Jinjiang Tu
2023-08-15 12:52 ` [PATCH 1/6] mm/page_owner: support identifying pages allocated by modules Jinjiang Tu
2023-08-15 12:52 ` [PATCH 2/6] mm/page_owner: show modules allocating pages when oom occurred Jinjiang Tu
2023-08-15 14:24   ` kernel test robot
2023-08-15 15:48   ` kernel test robot
2023-08-15 12:52 ` [PATCH 3/6] tools/vm/page_owner_sort: support for selecting by module name Jinjiang Tu
2023-08-15 12:52 ` [PATCH 4/6] tools/vm/page_owner_sort: support for culling " Jinjiang Tu
2023-08-15 12:52 ` [PATCH 5/6] tools/vm/page_owner_sort: support sorting " Jinjiang Tu
2023-08-15 12:52 ` [PATCH 6/6] Documentation: update document for page_owner Jinjiang Tu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox