From 3a85e55fffc5492a9223f8200ce707f4f4839082 Mon Sep 17 00:00:00 2001 From: visa Date: Wed, 22 Jun 2022 14:10:49 +0000 Subject: [PATCH] Document a locking constraint that applies to barriers. OK cheloha@ --- share/man/man9/smr_call.9 | 10 ++++++++-- share/man/man9/task_add.9 | 11 +++++++++-- share/man/man9/timeout.9 | 11 +++++++++-- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/share/man/man9/smr_call.9 b/share/man/man9/smr_call.9 index c735088489e..2bce55e624f 100644 --- a/share/man/man9/smr_call.9 +++ b/share/man/man9/smr_call.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: smr_call.9,v 1.3 2020/02/25 16:53:25 visa Exp $ +.\" $OpenBSD: smr_call.9,v 1.4 2022/06/22 14:10:49 visa Exp $ .\" .\" Copyright (c) 2019 Visa Hankala .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: February 25 2020 $ +.Dd $Mdocdate: June 22 2022 $ .Dt SMR_CALL 9 .Os .Sh NAME @@ -96,6 +96,12 @@ but the system is forced to process the request as soon as possible. The use of this function is discouraged because of the heavy impact on system performance. .Pp +To avoid deadlocks, the caller of +.Fn smr_barrier +or +.Fn smr_flush +must not hold locks that can block the processing of SMR callbacks. +.Pp The SMR implementation does not limit the number of deferred calls. It is important to prevent arbitrary call rate of .Fn smr_call . diff --git a/share/man/man9/task_add.9 b/share/man/man9/task_add.9 index aaf752f9cfe..1d27044bcb3 100644 --- a/share/man/man9/task_add.9 +++ b/share/man/man9/task_add.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: task_add.9,v 1.22 2020/06/08 00:29:51 dlg Exp $ +.\" $OpenBSD: task_add.9,v 1.23 2022/06/22 14:10:49 visa Exp $ .\" .\" Copyright (c) 2013 David Gwynne .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: June 8 2020 $ +.Dd $Mdocdate: June 22 2022 $ .Dt TASK_ADD 9 .Os .Sh NAME @@ -108,6 +108,13 @@ from the list of pending tasks on the .Fa tq taskq, or waits until any running task has completed. .Pp +The caller of +.Fn taskq_barrier +or +.Fn taskq_del_barrier +must not hold locks that can block the taskq. +Otherwise, the system will deadlock. +.Pp It is the responsibility of the caller to provide the .Fn task_set , .Fn task_add , diff --git a/share/man/man9/timeout.9 b/share/man/man9/timeout.9 index e1acee157c6..7cd51f32c05 100644 --- a/share/man/man9/timeout.9 +++ b/share/man/man9/timeout.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: timeout.9,v 1.54 2022/03/31 17:27:23 naddy Exp $ +.\" $OpenBSD: timeout.9,v 1.55 2022/06/22 14:10:49 visa Exp $ .\" .\" Copyright (c) 2000 Artur Grabowski .\" All rights reserved. @@ -23,7 +23,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 31 2022 $ +.Dd $Mdocdate: June 22 2022 $ .Dt TIMEOUT_SET 9 .Os .Sh NAME @@ -195,6 +195,13 @@ ensures that any current execution of the timeout in the argument .Fa to has completed before returning. .Pp +The caller of +.Fn timeout_barrier +or +.Fn timeout_del_barrier +must not hold locks that can block processing in the timeout's context. +Otherwise, the system will deadlock. +.Pp The .Fn timeout_pending macro can be used to check if a timeout is scheduled to run. -- 2.20.1