Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f8c7901 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull workqueue update from Tejun Heo:
 "Workqueue changes for v4.5.  One cleanup patch and three to improve
  the debuggability.

  Workqueue now has a stall detector which dumps workqueue state if any
  worker pool hasn't made forward progress over a certain amount of time
  (30s by default) and also triggers a warning if a workqueue which can
  be used in memory reclaim path tries to wait on something which can't
  be.

  These should make workqueue hangs a lot easier to debug."

* 'for-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
  workqueue: simplify the apply_workqueue_attrs_locked()
  workqueue: implement lockup detector
  watchdog: introduce touch_softlockup_watchdog_sched()
  workqueue: warn if memory reclaim tries to flush !WQ_MEM_RECLAIM workqueue
parents 3d116a66 6201171e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -4140,6 +4140,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
			or other driver-specific files in the
			Documentation/watchdog/ directory.

	workqueue.watchdog_thresh=
			If CONFIG_WQ_WATCHDOG is configured, workqueue can
			warn stall conditions and dump internal state to
			help debugging.  0 disables workqueue stall
			detection; otherwise, it's the stall threshold
			duration in seconds.  The default value is 30 and
			it can be updated at runtime by writing to the
			corresponding sysfs file.

	workqueue.disable_numa
			By default, all work items queued to unbound
			workqueues are affine to the NUMA nodes they're
+4 −0
Original line number Diff line number Diff line
@@ -377,6 +377,7 @@ extern void scheduler_tick(void);
extern void sched_show_task(struct task_struct *p);

#ifdef CONFIG_LOCKUP_DETECTOR
extern void touch_softlockup_watchdog_sched(void);
extern void touch_softlockup_watchdog(void);
extern void touch_softlockup_watchdog_sync(void);
extern void touch_all_softlockup_watchdogs(void);
@@ -387,6 +388,9 @@ extern unsigned int softlockup_panic;
extern unsigned int  hardlockup_panic;
void lockup_detector_init(void);
#else
static inline void touch_softlockup_watchdog_sched(void)
{
}
static inline void touch_softlockup_watchdog(void)
{
}
+6 −0
Original line number Diff line number Diff line
@@ -618,4 +618,10 @@ static inline int workqueue_sysfs_register(struct workqueue_struct *wq)
{ return 0; }
#endif	/* CONFIG_SYSFS */

#ifdef CONFIG_WQ_WATCHDOG
void wq_watchdog_touch(int cpu);
#else	/* CONFIG_WQ_WATCHDOG */
static inline void wq_watchdog_touch(int cpu) { }
#endif	/* CONFIG_WQ_WATCHDOG */

#endif
+1 −1
Original line number Diff line number Diff line
@@ -354,7 +354,7 @@ void sched_clock_idle_wakeup_event(u64 delta_ns)
		return;

	sched_clock_tick();
	touch_softlockup_watchdog();
	touch_softlockup_watchdog_sched();
}
EXPORT_SYMBOL_GPL(sched_clock_idle_wakeup_event);

+3 −3
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs)
	 * when we go busy again does not account too much ticks.
	 */
	if (ts->tick_stopped) {
		touch_softlockup_watchdog();
		touch_softlockup_watchdog_sched();
		if (is_idle_task(current))
			ts->idle_jiffies++;
	}
@@ -430,7 +430,7 @@ static void tick_nohz_update_jiffies(ktime_t now)
	tick_do_update_jiffies64(now);
	local_irq_restore(flags);

	touch_softlockup_watchdog();
	touch_softlockup_watchdog_sched();
}

/*
@@ -717,7 +717,7 @@ static void tick_nohz_restart_sched_tick(struct tick_sched *ts, ktime_t now, int
	update_cpu_load_nohz(active);

	calc_load_exit_idle();
	touch_softlockup_watchdog();
	touch_softlockup_watchdog_sched();
	/*
	 * Cancel the scheduled timer and restore the tick
	 */
Loading