From owner-dev-commits-src-main@freebsd.org Sun Dec 27 01:01:32 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE5BD4C756A; Sun, 27 Dec 2020 01:01:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3Mnm6TdSz3CKV; Sun, 27 Dec 2020 01:01:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1E061E734; Sun, 27 Dec 2020 01:01:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BR11Wqj074592; Sun, 27 Dec 2020 01:01:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BR11Wle074591; Sun, 27 Dec 2020 01:01:32 GMT (envelope-from git) Date: Sun, 27 Dec 2020 01:01:32 GMT Message-Id: <202012270101.0BR11Wle074591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 43c273489523 - main - jail: Make comments on struct prison locking more precise MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43c273489523fa39232b499ac547720f45dfffcf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 01:01:33 -0000 The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=43c273489523fa39232b499ac547720f45dfffcf commit 43c273489523fa39232b499ac547720f45dfffcf Author: Jamie Gritton AuthorDate: 2020-12-27 01:01:16 +0000 Commit: Jamie Gritton CommitDate: 2020-12-27 01:01:16 +0000 jail: Make comments on struct prison locking more precise --- sys/sys/jail.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/sys/jail.h b/sys/sys/jail.h index 2a6ee07ecc47..b95406079ea1 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -150,15 +150,17 @@ struct prison_racct; * * Lock key: * (a) allprison_lock - * (p) locked by pr_mtx + * (m) locked by pr_mtx + * (p) locked by pr_mtx, and also at least shared allprison_lock required + * to update * (c) set only during creation before the structure is shared, no mutex * required to read */ struct prison { TAILQ_ENTRY(prison) pr_list; /* (a) all prisons */ int pr_id; /* (c) prison id */ - int pr_ref; /* (p) refcount */ - int pr_uref; /* (p) user (alive) refcount */ + int pr_ref; /* (m) refcount */ + int pr_uref; /* (m) user (alive) refcount */ unsigned pr_flags; /* (p) PR_* flags */ LIST_HEAD(, prison) pr_children; /* (a) list of child jails */ LIST_ENTRY(prison) pr_sibling; /* (a) next in parent's list */