Skip to content

dump_stack: allow specifying printk log level

[email protected] linux-mm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5dump_stack: pass log level to dump_stack_print_info()lib/dump_stack.c+11 -50 replies
2/5dump_stack: introduce dump_stack_lvlinclude/linux/printk.h lib/dump_stack.c+12 -00 replies
3/5dump_stack: introduce generic show_stack_lvl()include/linux/sched.h lib/dump_stack.c+9 -10 replies
4/5x86: dumpstack - implement show_stack_lvl()arch/x86/kernel/dumpstack.c+7 -21 reply
5/5mm: use KERN_DEBUG for dump_stack() during an OOMmm/oom_kill.c+1 -11 reply

Reviews trailers per patch

2 of 5 patches have a Reviewed-by or Acked-by.

PatchIngo MolnarMichal Hocko
1/5
2/5
3/5
4/5A-b
5/5A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] dump_stack: allow specifying printk log level

This patchset lays the foundation work to allow using dump_stack() with a specified printk log level. Currently each architecture uses a different log level in show_stack() and it's not possible to control it without calling directly architecture specific functions.

The motivation behind this work is to limit the amount of kernel messages printed in the console when a process is killed by the OOM killer. In some scenarios (lots of containers running different customers' workloads) OOMs are way more common and don't require the console to be flooded by stack traces when the OOM killer probably did the right choice. During a recent discussion it was determined that a knob to control when dump_stack() is called is a bad idea and instead we should tune the log level in dump_stack() which prompted this work.

This patchset introduces two new functions:
dump_stack_lvl(char *log_lvl)
show_stack_lvl(struct task_struct *task, unsigned long *sp, char *log_lvl)

and both can be reimplemented by each architecture but only the second is expected. The idea is to initially implement show_stack_lvl() in all architectures then simply have show_stack() to require log_lvl as parameter. While that happens, dump_stack() uses can be changed to dump_stack_lvl() and once everything is in place, dump_stack() will require the log_level as well.

I have a draft patch for every architecture but for this patchset I'm only including x86 to get some feedback while I try to get a cross compiler working for each one of them (which is being harder than I thought).

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Greg Thelen <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc David Rientjes <[email protected]>
Signature · 7 lines
Aristeu

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>