Page MenuHomeFreeBSD

LinuxKPI: Add cancel_work() function.
ClosedPublic

Authored by wulf on Nov 28 2023, 9:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 9, 12:22 PM
Unknown Object (File)
Mon, Jun 8, 11:26 PM
Unknown Object (File)
Mon, Jun 8, 11:18 AM
Unknown Object (File)
Apr 28 2026, 7:41 AM
Unknown Object (File)
Apr 27 2026, 5:34 PM
Unknown Object (File)
Apr 27 2026, 5:27 PM
Unknown Object (File)
Apr 27 2026, 3:56 PM
Unknown Object (File)
Apr 26 2026, 6:09 AM

Details

Summary

Cancel a work not waiting for it to finish.

Sponsored by: Serenity Cyber Security, LLC
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 54667
Build 51556: arc lint + arc unit

Event Timeline

wulf requested review of this revision.Nov 28 2023, 9:12 PM
This revision is now accepted and ready to land.Nov 29 2023, 6:14 AM
kib added inline comments.
sys/compat/linuxkpi/common/src/linux_work.c
374

Should this case be asserted?

sys/compat/linuxkpi/common/src/linux_work.c
374

Yes please. I see this is copied from other functions, perhaps the to-state should be WORK_ST_INVALID, and linux_update_state() can assert that pstate[c] is never invalid.

384

We do this non-atomically after the state has transitioned to idle. What if some other thread tries to queue work, so the state goes back from ST_IDLE to ST_TASK, but then queues work before the taskqueue_cancel() call? The state will be left at ST_TASK even though all work is cancelled.

This revision was automatically updated to reflect the committed changes.