This removes uses of TIMER_DEFERRED_INITIALIZER and chooses a location to call timer_setup() from before add_timer() or mod_timer() is called. Adjusts callbacks to use from_timer() as needed.
Showing the changes to kernel/workqueue.c (1 of 3 files). Show all
Unified · Split
| @@ -5390,11 +5390,8 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq) { } · 5389 unmodified lines | |||
| 5390 | */ | 5390 | */ |
| 5391 | #ifdef CONFIG_WQ_WATCHDOG | 5391 | #ifdef CONFIG_WQ_WATCHDOG |
| 5392 | 5392 | ||
| 5393 | static void wq_watchdog_timer_fn(unsigned long data); | ||
| 5394 | |||
| 5395 | static unsigned long wq_watchdog_thresh = 30; | 5393 | static unsigned long wq_watchdog_thresh = 30; |
| 5396 | static struct timer_list wq_watchdog_timer = | 5394 | static struct timer_list wq_watchdog_timer; |
| 5397 | TIMER_DEFERRED_INITIALIZER(wq_watchdog_timer_fn, 0, 0); | ||
| 5398 | 5395 | ||
| 5399 | static unsigned long wq_watchdog_touched = INITIAL_JIFFIES; | 5396 | static unsigned long wq_watchdog_touched = INITIAL_JIFFIES; |
| 5400 | static DEFINE_PER_CPU(unsigned long, wq_watchdog_touched_cpu) = INITIAL_JIFFIES; | 5397 | static DEFINE_PER_CPU(unsigned long, wq_watchdog_touched_cpu) = INITIAL_JIFFIES; |
| @@ -5408,7 +5405,7 @@ static void wq_watchdog_reset_touched(void) · 7 unmodified lines | |||
| 5408 | per_cpu(wq_watchdog_touched_cpu, cpu) = jiffies; | 5405 | per_cpu(wq_watchdog_touched_cpu, cpu) = jiffies; |
| 5409 | } | 5406 | } |
| 5410 | 5407 | ||
| 5411 | static void wq_watchdog_timer_fn(unsigned long data) | 5408 | static void wq_watchdog_timer_fn(struct timer_list *unused) |
| 5412 | { | 5409 | { |
| 5413 | unsigned long thresh = READ_ONCE(wq_watchdog_thresh) * HZ; | 5410 | unsigned long thresh = READ_ONCE(wq_watchdog_thresh) * HZ; |
| 5414 | bool lockup_detected = false; | 5411 | bool lockup_detected = false; |
| @@ -5510,6 +5507,7 @@ module_param_cb(watchdog_thresh, &wq_watchdog_thresh_ops, &wq_watchdog_thresh, · 95 unmodified lines | |||
| 5510 | 5507 | ||
| 5511 | static void wq_watchdog_init(void) | 5508 | static void wq_watchdog_init(void) |
| 5512 | { | 5509 | { |
| 5510 | timer_setup(&wq_watchdog_timer, wq_watchdog_timer_fn, TIMER_DEFERRABLE); | ||
| 5513 | wq_watchdog_set_thresh(wq_watchdog_thresh); | 5511 | wq_watchdog_set_thresh(wq_watchdog_thresh); |
| 5514 | } | 5512 | } |
| 5515 | 5513 | ||