[PATCH 0/8] dyndbg: WIP diet plan

Jim Cromie jim.cromie at gmail.com
Wed Aug 5 14:30:15 EDT 2020


dynamic-debug metadata is bloated; the __dyndbg linker section is
effectively an array of struct _ddebugs, its 1st 3 members are highly
repetetive, with 90%, 84%, 45% repeats.  Total reported usage ~150kb
for ~2600 callsites on my laptop config.

This patchset is one diet plan. it all holds together nicely until the
"cache" commit, when it blows up starting init (or right after freeing
unused kernel image, which Im hoping to do...).  The following commit
tweaks locking in an attempt to recover, but fails.


[    0.737936] Freeing unused kernel image (initmem) memory: 1196K
[    0.740173] Write protecting the kernel read-only data: 22528k
[    0.743555] Freeing unused kernel image (text/rodata gap) memory: 2040K
[    0.744984] Freeing unused kernel image (rodata/data gap) memory: 256K
[    0.757777] Run /bin/sh as init process
q[    1.029548] Kernel panic - not syncing: Requested init /bin/sh failed (error -14).
[    1.034582] CPU: 0 PID: 1 Comm: sh Not tainted 5.8.0-00026-g9a06159192d6 #14
[    1.036068] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-2.fc32 04/01/2014
[    1.037885] Call Trace:
[    1.038444]  dump_stack+0x5e/0x7a
[    1.039172]  ? memcpy_orig+0x100/0x10f
[    1.039917]  panic+0xf6/0x2b7
[    1.040573]  ? rest_init+0xa0/0xa0
[    1.041314]  kernel_init+0xaa/0x100
[    1.041956]  ret_from_fork+0x22/0x30
[    1.042668] Kernel Offset: disabled
[    1.043216] ---[ end Kernel panic - not syncing: Requested init /bin/sh failed (error -14). ]---
QEMU 4.2.1 monitor - type 'help' for more information
(qemu) q

Im sending to kernelnewbies 1st, to see if theres any low-speed
test-crashes I can get post-mortems of, before I take it to the races.

Id appreciate any reviews, tests, or opinions you all might offer (in
that order).  I built for and tested on a virtme instance, 4/5 configs
build and test sane as described, the 5th is probly dead from too many
hacks.

if you use git, and wanna just try it, you can find it here:
  git remote add .. # u dont need full clone
  https://github.com/jimc/linux.git  dyndbg-diet branch

I had good success with virtme, -q=-s -q=-S, and gdb target remote,
all newbies should try it.

These are on top of 5.8.0 +18 others, which GregKH added to his
char-misc-testing &next trees.


Jim Cromie (8):
  dyndbg: give %3u width in pr-format, cosmetic only
  dyndbg: motivate a diet plan
  dyndbg: select ZPOOL in Kconfig.debug
  dyndbg: split struct _ddebug in 2, creating _ddebug_callsite
  dyndbg: WIP replace __dyndbg_callsite section with a zs-pool copy.
  dyndbg: ddebug_zpool_remove
  dyndbg: enable 'cache' of active pr_debug callsites
  dyndbg: add locking around zpool-add loop in zpool-init

 include/asm-generic/vmlinux.lds.h |   4 +
 include/linux/dynamic_debug.h     |  39 ++++--
 lib/Kconfig.debug                 |   1 +
 lib/dynamic_debug.c               | 223 +++++++++++++++++++++++++-----
 4 files changed, 223 insertions(+), 44 deletions(-)

-- 
2.26.2




More information about the Kernelnewbies mailing list