History

timer: Remove users of TIMER_DEFERRED_INITIALIZER

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.

Kees Cook committed 9 years ago

Commit 5cd79d61 parent df7e8283 files · +9 −11Browse files

Showing the changes to kernel/workqueue.c (1 of 3 files). Show all

Unified · Split

kernel/workqueue.c+3−5
@@ -5390,11 +5390,8 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq) { } · 5389 unmodified lines
5390 */5390 */
5391#ifdef CONFIG_WQ_WATCHDOG5391#ifdef CONFIG_WQ_WATCHDOG
5392 5392
5393static void wq_watchdog_timer_fn(unsigned long data);
5394
5395static unsigned long wq_watchdog_thresh = 30;5393static unsigned long wq_watchdog_thresh = 30;
5396static struct timer_list wq_watchdog_timer =5394static struct timer_list wq_watchdog_timer;
5397 TIMER_DEFERRED_INITIALIZER(wq_watchdog_timer_fn, 0, 0);
5398 5395
5399static unsigned long wq_watchdog_touched = INITIAL_JIFFIES;5396static unsigned long wq_watchdog_touched = INITIAL_JIFFIES;
5400static DEFINE_PER_CPU(unsigned long, wq_watchdog_touched_cpu) = INITIAL_JIFFIES;5397static 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
5411static void wq_watchdog_timer_fn(unsigned long data)5408static 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
5511static void wq_watchdog_init(void)5508static 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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t