From: Kent Overstreet <kent.overstreet@gmail.com>
To: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-fsdevel@vger.kernel.org
Cc: Kent Overstreet <kent.overstreet@gmail.com>,
hch@lst.de, hannes@cmpxchg.org, akpm@linux-foundation.org,
linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-input@vger.kernel.org, roman.gushchin@linux.dev
Subject: [PATCH v2 0/8] Printbufs & improved shrinker debugging
Date: Thu, 21 Apr 2022 19:48:29 -0400 [thread overview]
Message-ID: <20220421234837.3629927-6-kent.overstreet@gmail.com> (raw)
In-Reply-To: <20220421234837.3629927-1-kent.overstreet@gmail.com>
v1 of this patch series here:
https://lore.kernel.org/linux-mm/20220419203202.2670193-1-kent.overstreet@gmail.com/T/
Changes since v1:
- Converted some, not all, seq_buf code to printbufs (thanks Christoph for
pointing out seq_buf).
The seq_buf code I didn't convert is arch specific code where the memory
allocation context is unclear, and they're using seq_buf to do everything on
the stack. I'm considering adding a mode to printbufs where we point it at an
external buffer instead - it wouldn't be much code, but OTOH seq_buf isn't
much code either and it seems to be somewhat tied to tracing infrastructure.
Deferring a decision on what to do for now.
- pr_human_readable_u64() now uses string_get_size() (thanks Matthew for
pointing this one out)
- added new helpers printbuf_str() for getting a guaranteed-null-terminated
string, and printbuf_atomic_inc() and printbuf_atomic_dec() for marking
sections where allocations must be GFP_ATOMIC.
- Broke out shrinker_to_text(): this new helper could be used by new sysfs or
debugfs code, for displaying information about a single shrinker (as Roman is
working on)
- Added new tracking, per shrinker, for # of objects requested to be freed and
# actually freed. Shrinkers won't necessarily free all objects requested for
perfectly legitimate reasons, but if the two numbers are wildly off then
that's going to lead to memory reclaim issues - these are both also included
in shrinker_to_text().
Kent Overstreet (8):
lib/printbuf: New data structure for heap-allocated strings
Input/joystick/analog: Convert from seq_buf -> printbuf
mm/memcontrol.c: Convert to printbuf
clk: tegra: bpmp: Convert to printbuf
mm: Add a .to_text() method for shrinkers
mm: Count requests to free & nr freed per shrinker
mm: Move lib/show_mem.c to mm/
mm: Centralize & improve oom reporting in show_mem.c
drivers/clk/tegra/clk-bpmp.c | 21 ++-
drivers/input/joystick/analog.c | 37 +++--
include/linux/printbuf.h | 164 +++++++++++++++++++
include/linux/shrinker.h | 8 +
lib/Makefile | 4 +-
lib/printbuf.c | 274 ++++++++++++++++++++++++++++++++
mm/Makefile | 2 +-
mm/memcontrol.c | 68 ++++----
mm/oom_kill.c | 23 ---
{lib => mm}/show_mem.c | 14 ++
mm/slab.h | 6 +-
mm/slab_common.c | 53 +++++-
mm/vmscan.c | 88 ++++++++++
13 files changed, 666 insertions(+), 96 deletions(-)
create mode 100644 include/linux/printbuf.h
create mode 100644 lib/printbuf.c
rename {lib => mm}/show_mem.c (77%)
--
2.35.2
next prev parent reply other threads:[~2022-04-21 23:48 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-21 23:48 [PATCH 0/4] Printbufs & shrinker OOM reporting Kent Overstreet
2022-04-21 23:48 ` [PATCH 1/4] lib/printbuf: New data structure for heap-allocated strings Kent Overstreet
2022-04-21 23:48 ` [PATCH 2/4] mm: Add a .to_text() method for shrinkers Kent Overstreet
2022-04-22 12:21 ` Michal Hocko
2022-04-21 23:48 ` [PATCH 3/4] mm: Centralize & improve oom reporting in show_mem.c Kent Overstreet
2022-04-21 23:48 ` [PATCH 4/4] bcachefs: shrinker.to_text() methods Kent Overstreet
2022-04-21 23:48 ` Kent Overstreet [this message]
2022-04-21 23:48 ` [PATCH v2 1/8] lib/printbuf: New data structure for heap-allocated strings Kent Overstreet
2022-04-22 4:20 ` Christoph Hellwig
2022-04-22 5:14 ` Kent Overstreet
2022-04-22 5:22 ` Christoph Hellwig
2022-04-22 5:40 ` Kent Overstreet
2022-04-22 5:52 ` Christoph Hellwig
2022-04-22 6:06 ` Kent Overstreet
2022-04-22 6:11 ` Christoph Hellwig
2022-04-22 6:18 ` Kent Overstreet
2022-04-22 15:37 ` Steven Rostedt
2022-04-22 19:30 ` Kent Overstreet
2022-04-22 19:39 ` Steven Rostedt
2022-04-22 20:30 ` Kent Overstreet
2022-04-22 20:47 ` Steven Rostedt
2022-04-22 21:51 ` Kent Overstreet
2022-04-22 22:20 ` Steven Rostedt
2022-04-22 20:03 ` James Bottomley
2022-04-22 21:13 ` Kent Overstreet
2022-04-23 14:16 ` Rust and Kernel Vendoring [Was Re: [PATCH v2 1/8] lib/printbuf: New data structure for heap-allocated strings] James Bottomley
2022-04-24 20:36 ` Kent Overstreet
2022-04-26 2:22 ` James Bottomley
2022-04-24 23:46 ` [PATCH v2 1/8] lib/printbuf: New data structure for heap-allocated strings Joe Perches
2022-04-25 0:45 ` Kent Overstreet
2022-04-25 2:44 ` Matthew Wilcox
2022-04-25 4:19 ` Kent Overstreet
2022-04-25 4:48 ` Joe Perches
2022-04-25 4:59 ` Kent Overstreet
2022-04-25 5:00 ` Joe Perches
2022-04-25 5:56 ` Kent Overstreet
2022-04-21 23:48 ` [PATCH v2 2/8] Input/joystick/analog: Convert from seq_buf -> printbuf Kent Overstreet
2022-04-21 23:48 ` [PATCH v2 3/8] mm/memcontrol.c: Convert to printbuf Kent Overstreet
2022-04-22 12:28 ` Michal Hocko
2022-04-21 23:48 ` [PATCH v2 4/8] clk: tegra: bpmp: " Kent Overstreet
2022-04-21 23:48 ` [PATCH v2 5/8] mm: Add a .to_text() method for shrinkers Kent Overstreet
2022-04-21 23:48 ` [PATCH v2 6/8] mm: Count requests to free & nr freed per shrinker Kent Overstreet
2022-04-21 23:48 ` [PATCH v2 7/8] mm: Move lib/show_mem.c to mm/ Kent Overstreet
2022-04-22 12:32 ` Michal Hocko
2022-04-21 23:48 ` [PATCH v2 8/8] mm: Centralize & improve oom reporting in show_mem.c Kent Overstreet
2022-04-22 12:58 ` Michal Hocko
2022-04-22 15:09 ` Roman Gushchin
2022-04-22 23:48 ` Kent Overstreet
2022-04-23 0:27 ` Roman Gushchin
2022-04-23 0:46 ` Kent Overstreet
2022-04-23 1:25 ` Roman Gushchin
2022-04-23 11:48 ` Tetsuo Handa
2022-04-25 9:28 ` Michal Hocko
2022-04-25 15:28 ` Kent Overstreet
2022-04-26 7:17 ` Michal Hocko
2022-04-26 7:26 ` Kent Overstreet
2022-04-26 7:40 ` Michal Hocko
2022-04-30 4:00 ` [PATCH 0/4] Printbufs & shrinker OOM reporting Dave Young
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220421234837.3629927-6-kent.overstreet@gmail.com \
--to=kent.overstreet@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hch@lst.de \
--cc=linux-clk@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-tegra@vger.kernel.org \
--cc=roman.gushchin@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox