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 (or schedule_work).
  • Teardown paths — .remove, module unload, .release — where a work_struct or the resources its function touches are about to be freed.
  • Deciding between flush_work, flush_workqueue, cancel_work, and cancel_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.

When not to use

Installs
1
GitHub Stars
2
First Seen
Oct 3, 2026