From c290f175e73fe04feba492e08a92093a4763914c Mon Sep 17 00:00:00 2001 From: Binbin Zhou Date: Wed, 22 Jun 2022 18:19:42 +0800 Subject: [PATCH] docs/zh_CN: core-api: Update the translation of workqueue.rst to 5.19-rc3 Synchronous translation from upstream commit f9eaaa82b474 ("workqueue: doc: Call out the non-reentrance conditions") Signed-off-by: Binbin Zhou Reviewed-by: Wu XiangCheng Reviewed-by: Yanteng Si Link: https://lore.kernel.org/r/d045cb5623b5ae703c2296d3caa05017d5d225bd.1655863769.git.zhoubinbin@loongson.cn Signed-off-by: Jonathan Corbet --- .../translations/zh_CN/core-api/workqueue.rst | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Documentation/translations/zh_CN/core-api/workqueue.rst b/Documentation/translations/zh_CN/core-api/workqueue.rst index e372fa5..f6567cf 100644 --- a/Documentation/translations/zh_CN/core-api/workqueue.rst +++ b/Documentation/translations/zh_CN/core-api/workqueue.rst @@ -6,6 +6,7 @@ :翻译: 司延腾 Yanteng Si + 周彬彬 Binbin Zhou .. _cn_workqueue.rst: @@ -178,10 +179,6 @@ workqueue将自动创建与属性相匹配的后备工作者池。调节并发 这个标志对于未绑定的wq来说是没有意义的。 -请注意,标志 ``WQ_NON_REENTRANT`` 不再存在,因为现在所有的工作 -队列都是不可逆的——任何工作项都保证在任何时间内最多被整个系统的一 -个工作者执行。 - ``max_active`` -------------- @@ -328,6 +325,22 @@ And with cmwq with ``@max_active`` >= 3, :: 工作项函数在堆栈追踪中应该是微不足道的。 +不可重入条件 +============ + +工作队列保证,如果在工作项排队后满足以下条件,则工作项不能重入: + + + 1. 工作函数没有被改变。 + 2. 没有人将该工作项排到另一个工作队列中。 + 3. 该工作项尚未被重新启动。 + +换言之,如果上述条件成立,则保证在任何给定时间最多由一个系统范围内的工作程序执行 +该工作项。 + +请注意,在self函数中将工作项重新排队(到同一队列)不会破坏这些条件,因此可以安全 +地执行此操作。否则在破坏工作函数内部的条件时需要小心。 + 内核内联文档参考 ================ -- 2.7.4