aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/workqueue.h
diff options
context:
space:
mode:
authorMaxime Ripard <maxime@cerno.tech>2020-04-04 11:02:15 +0200
committerMaxime Ripard <maxime@cerno.tech>2020-04-04 11:02:15 +0200
commitcc46c03397c1865a181f1a4f66d4645806e5a943 (patch)
treee3a762d8961219a61b96ae6e5ec875ba9fbe2314 /include/linux/workqueue.h
parentd8a26d8fc37c5b8b9e95f2fa194f287cf8cab3f4 (diff)
parent0e7e6198af28c1573267aba1be33dd0b7fb35691 (diff)
downloadkernel_replicant_linux-cc46c03397c1865a181f1a4f66d4645806e5a943.tar.gz
kernel_replicant_linux-cc46c03397c1865a181f1a4f66d4645806e5a943.tar.bz2
kernel_replicant_linux-cc46c03397c1865a181f1a4f66d4645806e5a943.zip
Merge drm/drm-next into drm-misc-next-fixes
Alex needs v5.6 into drm-misc-next-fixes to merge a fix for a regression in the scatterlist processing in PRIME. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'include/linux/workqueue.h')
-rw-r--r--include/linux/workqueue.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 4261d1c6e87b..e48554e6526c 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -487,6 +487,19 @@ extern void wq_worker_comm(char *buf, size_t size, struct task_struct *task);
*
* We queue the work to the CPU on which it was submitted, but if the CPU dies
* it can be processed by another CPU.
+ *
+ * Memory-ordering properties: If it returns %true, guarantees that all stores
+ * preceding the call to queue_work() in the program order will be visible from
+ * the CPU which will execute @work by the time such work executes, e.g.,
+ *
+ * { x is initially 0 }
+ *
+ * CPU0 CPU1
+ *
+ * WRITE_ONCE(x, 1); [ @work is being executed ]
+ * r0 = queue_work(wq, work); r1 = READ_ONCE(x);
+ *
+ * Forbids: r0 == true && r1 == 0
*/
static inline bool queue_work(struct workqueue_struct *wq,
struct work_struct *work)
@@ -546,6 +559,9 @@ static inline bool schedule_work_on(int cpu, struct work_struct *work)
* This puts a job in the kernel-global workqueue if it was not already
* queued and leaves it in the same position on the kernel-global
* workqueue otherwise.
+ *
+ * Shares the same memory-ordering properties of queue_work(), cf. the
+ * DocBook header of queue_work().
*/
static inline bool schedule_work(struct work_struct *work)
{