From nobody Fri Jun 17 19:37:28 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6B7D585A995; Fri, 17 Jun 2022 19:37:31 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LPq7Y51j9z3Pqk; Fri, 17 Jun 2022 19:37:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CI/k0A9ToXrLv6a2bKAIUM/R38v6ewBwFJK5OF/2uMg=; b=CVNnWjbwF1rrPkc4YQmmO9/yUri9RY6fc2BwIkWLYx9spqBqo6F26HTh7pF6c96luOdtj6 F+t3x/i9zCUw65mSC3UHa9DTt6HF1B2uDsAPAePM3Zjbd8L3UCK4m0Q2Mhp/6P8cfi9LCF Hq9BkI/6+nnnmPjMnjB9Y+4vmIaNkZzPd4Xz6ZbpPW53Nz9pX7NiTAp7Xzr4rpQfbcjEPS w1amigi7OtXR61h+jiskXpBMrL4sNvylq/wi2USn6gX+r9ciAt26o9Ecu2mIQbG1i4FqGN uAjtHSRv3Q0G+wKhwWxe9AGIDQEpcPNYVfNyHhat2W2gNmCZ0Q6sAvH5+bfonw== 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 0A0A025A32; Fri, 17 Jun 2022 19:37:29 +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 25HJbSuB013413; Fri, 17 Jun 2022 19:37:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJbSc0013412; Fri, 17 Jun 2022 19:37:28 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:37:28 GMT Message-Id: <202206171937.25HJbSc0013412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 360efef2c0ee - stable/13 - umtx: Expose some of the pi umtx structures and API to the rest of the kernel. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 360efef2c0eeb3697370db6d0ad61f1354f2417b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CI/k0A9ToXrLv6a2bKAIUM/R38v6ewBwFJK5OF/2uMg=; b=MNWL/l5zkC96EMXnuhT+T+p5f1hmgTIsI1e/fnER9NeT57dEKDF3lW30akXdYr3doE4BmK vfzqBFpv75wJvptgpZP3ryTBoFSswadjZTe87Pn+lJquzkeSLb1OdL1aglZEGV6xfwp8u6 17b7cqqNxw6u3LhlonEe/2INu06eU07fHjxvcuRCywgLpbuIJpWI952oLs/C5jRIne3OmJ oHo+EA7peu29IugrSWL98HcAElKFJVy2ptyEb5Icf5GLX/qjqIEjxUW2RLnPjbqXFPhEoi MddcZGz9zG8yHtUtAax/j12qqB82uYw6FoM+vZs3X3Vzehlk+JtDSs/0oKWdtA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494649; a=rsa-sha256; cv=none; b=vR5Re36gX9SrZ8yPPV8XGD7zvXDCPxZI4ccyLrkptaZCB1aWYTozgkbqUz7HfT0/c9+a3n +nG5xubCoMvmnSZEy9oDxEd5+La3Mj5MjcAxstdcy/ZBVBeaqJEIYgChA8V8b7HdQ7dGzO 9Wg+Ot/Gc0zJSk+gRUn89dlZt8nI968C3+eewxG9SGnaWF5WZOHzVzEd6NQx19xcQaS1bl 2jIA2+NugaMO8qTdF4TIrdanZW9pGUs6FBxR2U85Dph0amOELJ3DsfdgcRtHINi/OR0ZlI r20bEEbYPe+wMDEmJaSsg3QAkpwzRDg2GCOS4LP6FNuOCLuom5+2iZaPzK1meQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=360efef2c0eeb3697370db6d0ad61f1354f2417b commit 360efef2c0eeb3697370db6d0ad61f1354f2417b Author: Dmitry Chagin AuthorDate: 2021-07-29 09:46:58 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:33:18 +0000 umtx: Expose some of the pi umtx structures and API to the rest of the kernel. Differential Revision: https://reviews.freebsd.org/D31237 MFC after: 2 weeks (cherry picked from commit 09f55e60024662d7a9da248257ec72cd86767cea) --- sys/kern/kern_umtx.c | 20 +++++++++----------- sys/sys/umtxvar.h | 10 ++++++++++ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 1ffa14b7cadb..f7d9d2ee4949 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -170,8 +170,6 @@ static inline void umtx_abs_timeout_update(struct umtx_abs_timeout *timo); static void umtx_shm_init(void); static void umtxq_sysinit(void *); static void umtxq_hash(struct umtx_key *key); -static struct umtx_pi *umtx_pi_alloc(int); -static void umtx_pi_free(struct umtx_pi *pi); static int do_unlock_pp(struct thread *td, struct umutex *m, uint32_t flags, bool rb); static void umtx_thread_cleanup(struct thread *td); @@ -435,7 +433,7 @@ umtxq_unbusy(struct umtx_key *key) wakeup_one(uc); } -static inline void +void umtxq_unbusy_unlocked(struct umtx_key *key) { @@ -1668,7 +1666,7 @@ do_wake2_umutex(struct thread *td, struct umutex *m, uint32_t flags) return (error); } -static inline struct umtx_pi * +struct umtx_pi * umtx_pi_alloc(int flags) { struct umtx_pi *pi; @@ -1679,7 +1677,7 @@ umtx_pi_alloc(int flags) return (pi); } -static inline void +void umtx_pi_free(struct umtx_pi *pi) { uma_zfree(umtx_pi_zone, pi); @@ -1888,7 +1886,7 @@ umtx_pi_disown(struct umtx_pi *pi) /* * Claim ownership of a PI mutex. */ -static int +int umtx_pi_claim(struct umtx_pi *pi, struct thread *owner) { struct umtx_q *uq; @@ -1946,7 +1944,7 @@ umtx_pi_adjust(struct thread *td, u_char oldpri) /* * Sleep on a PI mutex. */ -static int +int umtxq_sleep_pi(struct umtx_q *uq, struct umtx_pi *pi, uint32_t owner, const char *wmesg, struct umtx_abs_timeout *timo, bool shared) { @@ -2014,7 +2012,7 @@ umtxq_sleep_pi(struct umtx_q *uq, struct umtx_pi *pi, uint32_t owner, /* * Add reference count for a PI mutex. */ -static void +void umtx_pi_ref(struct umtx_pi *pi) { @@ -2026,7 +2024,7 @@ umtx_pi_ref(struct umtx_pi *pi) * Decrease reference count for a PI mutex, if the counter * is decreased to zero, its memory space is freed. */ -static void +void umtx_pi_unref(struct umtx_pi *pi) { struct umtxq_chain *uc; @@ -2049,7 +2047,7 @@ umtx_pi_unref(struct umtx_pi *pi) /* * Find a PI mutex in hash table. */ -static struct umtx_pi * +struct umtx_pi * umtx_pi_lookup(struct umtx_key *key) { struct umtxq_chain *uc; @@ -2069,7 +2067,7 @@ umtx_pi_lookup(struct umtx_key *key) /* * Insert a PI mutex into hash table. */ -static inline void +void umtx_pi_insert(struct umtx_pi *pi) { struct umtxq_chain *uc; diff --git a/sys/sys/umtxvar.h b/sys/sys/umtxvar.h index ed2d8046a5fb..fd193de5818b 100644 --- a/sys/sys/umtxvar.h +++ b/sys/sys/umtxvar.h @@ -214,9 +214,19 @@ int umtxq_requeue(struct umtx_key *, int, struct umtx_key *, int); int umtxq_signal_mask(struct umtx_key *, int, u_int); int umtxq_sleep(struct umtx_q *, const char *, struct umtx_abs_timeout *); +int umtxq_sleep_pi(struct umtx_q *, struct umtx_pi *, uint32_t, + const char *, struct umtx_abs_timeout *, bool); void umtxq_unbusy(struct umtx_key *); +void umtxq_unbusy_unlocked(struct umtx_key *); int kern_umtx_wake(struct thread *, void *, int, int); void umtx_pi_adjust(struct thread *, u_char); +struct umtx_pi *umtx_pi_alloc(int); +int umtx_pi_claim(struct umtx_pi *, struct thread *); +void umtx_pi_free(struct umtx_pi *); +void umtx_pi_insert(struct umtx_pi *); +struct umtx_pi *umtx_pi_lookup(struct umtx_key *); +void umtx_pi_ref(struct umtx_pi *); +void umtx_pi_unref(struct umtx_pi *); void umtx_thread_init(struct thread *); void umtx_thread_fini(struct thread *); void umtx_thread_alloc(struct thread *);