schedule_work(9)
πΈ NAME πΈ
okay bestie, welcome to schedule_work(9) from the Kernel API Manual β it's giving put work task in per-CPU workqueue, and that's literally the whole vibe. This is the little function that puts your work task in the system per-CPU workqueue. π
β¨ SYNOPSIS β¨
here's the signature, copy it exactly, no cap:
bool schedule_work (struct work_struct *work );
π ARGUMENTS π
workβ job to be done. literally the work item, bestie. π«Ά
π DESCRIPTION π
So here's the tea: it returns false if work was already on the system per-CPU workqueue, and true otherwise. π
It puts a job in the system per-CPU workqueue if it was not already queued, and leaves it in the same position on the system per-CPU workqueue otherwise. no reshuffling, no drama. π
It shares the same memory-ordering properties of queue_work, cf. the DocBook header of queue_work. that part is important, iykyk. β¨
π¦ SEE ALSO π¦
go read these too, bestie:
- Kernel file
./include/linux/workqueue.hstructworkqueue_attrs(9) work_pending(9)delayed_work_pending(9)alloc_workqueue(9)devm_alloc_workqueue(9)alloc_workqueue_lockdep_map(9)alloc_ordered_workqueue_lockdep_map(9)alloc_ordered_workqueue(9)queue_work(9)queue_delayed_work(9)mod_delayed_work(9)schedule_work_on(9)enable_and_queue_work(9)schedule_delayed_work_on(9)schedule_delayed_work(9)
π signed off from the ./include/linux source, dated October 2026, page schedule_work(9) β bye bestie, slay your workqueue π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms