workqueue-flush-and-cancellation
Installation
SKILL.md
Workqueue Flush & Cancellation
The Linux workqueue contract for shutting down deferred work without
use-after-free or deadlock. Load references/README.md before writing any
queue_work/flush_work/cancel_work_sync teardown path.
When to use
- Writing or reviewing driver/subsystem code that defers work with
queue_work/queue_work_on(orschedule_work). - Teardown paths —
.remove, module unload,.release— where awork_structor the resources its function touches are about to be freed. - Deciding between
flush_work,flush_workqueue,cancel_work, andcancel_work_sync, or reviewing an existing call. - Work items that reschedule themselves (self-requeue polling pattern).
- Debugging unload hangs, kworker use-after-free reports, or lockdep "recursive locking" / WQ-flush reports.