Skip to content

RFC how to reclaim unneeded vmlinux memory ?

Jim Cromie linux-mm lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest10 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10dyndbg: prep to isolate 3 repetetive fieldsinclude/linux/dynamic_debug.h lib/dynamic_debug.c+30 -200 replies
2/10dyndbg: split __dyndbg_sites section out from __dyndbginclude/asm-generic/vmlinux.lds.h include/linux/dynamic_debug.h kernel/module/main.c +1 more+33 -170 replies
3/10dyndbg: add 2nd cursor pair to init-fnlib/dynamic_debug.c+10 -10 replies
4/10dyndbg: save _ddebug_site mod,file,func fields into maple-treeslib/dynamic_debug.c+142 -00 replies
5/10dyndbg: avoid _ddebug.site in ddebug_condense_siteslib/dynamic_debug.c+24 -150 replies
6/10dyndbg: add site_*() macros to avoid using _ddebug.sitelib/dynamic_debug.c+16 -130 replies
7/10dyndbg: wire in __desc_*() functionslib/dynamic_debug.c+10 -100 replies
8/10dyndbg: drop _ddebug.site memberinclude/linux/dynamic_debug.h+2 -40 replies
9/10dyndbg: add dd_clear_range to prune mtreeslib/dynamic_debug.c+10 -00 replies
10/10dyndbg: cache the dynamically generated prefixes per callsitelib/dynamic_debug.c+26 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 00/10] how to reclaim unneeded vmlinux memory ?

For builtin modules, dynamic-debug allocates blocks of memory into DATA, via vmlinux.lds.h.

dyndbg's struct _ddebug has fields: modname, filename, function, which keeps the the code's structural/organizational info used to enable & prefix prdbg callsites.

The linker packs the callsites in-order, which means the repetition in those 3 columns can be compactly encoded in non-overlapping intervals.

So this saves each unique column-val and its interval into a maple-tree per column, and retrieves them as needed with accessors.

It also splits out _ddebug_site and __dyndbg_sites section, and no longer needs the section, so that block is ready to reclaim.

Somethings wrong with patch-9, but it seems worth showing around.

Jim Cromie (10):
dyndbg: prep to isolate 3 repetetive fields
dyndbg: split __dyndbg_sites section out from __dyndbg
dyndbg: add 2nd cursor pair to init-fn
dyndbg: save _ddebug_site mod,file,func fields into maple-trees
dyndbg: avoid _ddebug.site in ddebug_condense_sites
dyndbg: add site_*() macros to avoid using _ddebug.site
dyndbg: wire in __desc_*() functions
dyndbg: drop _ddebug.site member
dyndbg: add dd_clear_range to prune mtrees
dyndbg: cache the dynamically generated prefixes per callsite

 include/asm-generic/vmlinux.lds.h |   1 +
 include/linux/dynamic_debug.h     |  40 +++--
 kernel/module/main.c              |   3 +
 lib/dynamic_debug.c               | 238 +++++++++++++++++++++++++++---
 4 files changed, 252 insertions(+), 30 deletions(-)
Signature · 1 line
2.41.0