History

kgdb: Remove kgdb_schedule_breakpoint()

To the very best of my knowledge there has never been any in-tree code that calls this function. It exists largely to support an out-of-tree driver that provides kgdb-over-ethernet using the netpoll API. kgdboe has been out-of-tree for more than 10 years and I don't recall any serious attempt to upstream it at any point in the last five. At this stage it looks better to stop carrying this code in the kernel and integrate the code into the out-of-tree driver instead. The long term trajectory for the kernel looks likely to include effort to remove or reduce the use of tasklets (something that has also been true for the last 10 years). Thus the main real reason for this patch is to make explicit that the in-tree kgdb features do not require tasklets.

Daniel Thompson committed 5 years ago

Commit f11e2bc1 parent 93f7a6d2 files · +0 −27Browse files

Showing the changes to kernel/debug/debug_core.c (1 of 2 files). Show all

Unified · Split

kernel/debug/debug_core.c+0−26
@@ -119,7 +119,6 @@ static DEFINE_RAW_SPINLOCK(dbg_slave_lock); · 118 unmodified lines
119 */119 */
120static atomic_t masters_in_kgdb;120static atomic_t masters_in_kgdb;
121static atomic_t slaves_in_kgdb;121static atomic_t slaves_in_kgdb;
122static atomic_t kgdb_break_tasklet_var;
123atomic_t kgdb_setting_breakpoint;122atomic_t kgdb_setting_breakpoint;
124 123
125struct task_struct *kgdb_usethread;124struct task_struct *kgdb_usethread;
@@ -1084,31 +1083,6 @@ static void kgdb_unregister_callbacks(void) · 958 unmodified lines
1084 }1083 }
1085}1084}
1086 1085
1087/*
1088 * There are times a tasklet needs to be used vs a compiled in
1089 * break point so as to cause an exception outside a kgdb I/O module,
1090 * such as is the case with kgdboe, where calling a breakpoint in the
1091 * I/O driver itself would be fatal.
1092 */
1093static void kgdb_tasklet_bpt(unsigned long ing)
1094{
1095 kgdb_breakpoint();
1096 atomic_set(&kgdb_break_tasklet_var, 0);
1097}
1098
1099static DECLARE_TASKLET_OLD(kgdb_tasklet_breakpoint, kgdb_tasklet_bpt);
1100
1101void kgdb_schedule_breakpoint(void)
1102{
1103 if (atomic_read(&kgdb_break_tasklet_var) ||
1104 atomic_read(&kgdb_active) != -1 ||
1105 atomic_read(&kgdb_setting_breakpoint))
1106 return;
1107 atomic_inc(&kgdb_break_tasklet_var);
1108 tasklet_schedule(&kgdb_tasklet_breakpoint);
1109}
1110EXPORT_SYMBOL_GPL(kgdb_schedule_breakpoint);
1111
1112/**1086/**
1113 * kgdb_register_io_module - register KGDB IO module1087 * kgdb_register_io_module - register KGDB IO module
1114 * @new_dbg_io_ops: the io ops vector1088 * @new_dbg_io_ops: the io ops vector