Skip to content

dyndbg: WIP diet plan

Jim Cromie kernelnewbies 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8dyndbg: give %3u width in pr-format, cosmetic onlylib/dynamic_debug.c+1 -10 replies
2/8dyndbg: motivate a diet planlib/dynamic_debug.c+15 -20 replies
3/8dyndbg: select ZPOOL in Kconfig.debuglib/Kconfig.debug+1 -00 replies
4/8dyndbg: split struct _ddebug in 2, creating _ddebug_callsiteinclude/asm-generic/vmlinux.lds.h include/linux/dynamic_debug.h lib/dynamic_debug.c+60 -340 replies
5/8dyndbg: WIP replace __dyndbg_callsite section with a zs-pool copy.include/linux/dynamic_debug.h lib/dynamic_debug.c+129 -120 replies
6/8dyndbg: ddebug_zpool_removelib/dynamic_debug.c+19 -00 replies
7/8dyndbg: enable 'cache' of active pr_debug callsiteslib/dynamic_debug.c+3 -10 replies
8/8dyndbg: add locking around zpool-add loop in zpool-initlib/dynamic_debug.c+2 -10 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/8] dyndbg: WIP diet plan

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(-)
Signature · 7 lines
2.26.2


_______________________________________________
Kernelnewbies mailing list
[email protected]
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies