mbox series

[0/7] shrinker debugging improvements

Message ID 20231122232515.177833-1-kent.overstreet@linux.dev (mailing list archive)
Headers show
Series shrinker debugging improvements | expand

Message

Kent Overstreet Nov. 22, 2023, 11:25 p.m. UTC
This patchset does a few things to aid in OOM debugging, in particular
when shrinkers are involved:

 - improves the show_mem OOM report: it now reports on shrinkers, and
   for both shrinkers and slab we only report the top 10 entries,
   sorted, not the full list

 - add shrinker_to_text(), for the show_mem report and debugfs, and a
   an optional shrinker.to_text() callback to report extra
   driver-specific information

 - add extra counters for the shrinker_to_text() report

 - implement shrinker.to_text() for bcachefs, giving an example of how
   to use the callbacks

Daniel Hill (1):
  bcachefs: add counters for failed shrinker reclaim

Kent Overstreet (6):
  seq_buf: seq_buf_human_readable_u64()
  mm: shrinker: Add a .to_text() method for shrinkers
  mm: shrinker: Add new stats for .to_text()
  mm: Centralize & improve oom reporting in show_mem.c
  mm: shrinker: Add shrinker_to_text() to debugfs interface
  bcachefs: shrinker.to_text() methods

 fs/bcachefs/btree_cache.c     | 102 +++++++++++++++++++++++++++-------
 fs/bcachefs/btree_cache.h     |   2 +-
 fs/bcachefs/btree_key_cache.c |  14 +++++
 fs/bcachefs/btree_types.h     |  10 ++++
 fs/bcachefs/sysfs.c           |   2 +-
 include/linux/seq_buf.h       |   4 ++
 include/linux/shrinker.h      |  12 +++-
 lib/seq_buf.c                 |  10 ++++
 mm/oom_kill.c                 |  23 --------
 mm/show_mem.c                 |  20 +++++++
 mm/shrinker.c                 |  89 ++++++++++++++++++++++++++++-
 mm/shrinker_debug.c           |  18 ++++++
 mm/slab.h                     |   6 +-
 mm/slab_common.c              |  52 ++++++++++++++---
 14 files changed, 305 insertions(+), 59 deletions(-)

Comments

Michal Hocko Nov. 28, 2023, 9:59 a.m. UTC | #1
On Wed 22-11-23 18:25:05, Kent Overstreet wrote:
> This patchset does a few things to aid in OOM debugging, in particular
> when shrinkers are involved:
> 
>  - improves the show_mem OOM report: it now reports on shrinkers, and
>    for both shrinkers and slab we only report the top 10 entries,
>    sorted, not the full list
> 
>  - add shrinker_to_text(), for the show_mem report and debugfs, and a
>    an optional shrinker.to_text() callback to report extra
>    driver-specific information
> 
>  - add extra counters for the shrinker_to_text() report
> 
>  - implement shrinker.to_text() for bcachefs, giving an example of how
>    to use the callbacks

Could you expand some more about all these? What is the additional
information you can get and how usable that is? Some examples would be
really useful in the cover letter to establish grounds for the
discussion.

/me is looking at patches to find out more.