From nobody Tue Aug 2 18:12:18 2022 X-Original-To: dev-commits-src-main@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 4Ly3426Mqtz4XqwJ; Tue, 2 Aug 2022 18:12:18 +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 4Ly3425rvzz40cN; Tue, 2 Aug 2022 18:12:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659463938; 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=0Mi6IF6yMsaGCyzkHnQGTKh8Nf/Wdnh0N6cZn0HblyY=; b=veWk1fTon70JcY9Get8y7K/J80gLrhmDKTw/42V1ZHp40jInzO9Ai2SpV4KBD/CLqtUAiv PvJ2LJvhew1jAQY9Dw21J1hnJKrpRFPf8dijYQl8ypAzb6WxoI9fYeUnRMMKiV43naKeVC UCw+39mdQT7UZEbq9Y4MiNEFUXZY5txZA2RxuejBp4AjWbYYKIFBpQ1HfPotsnMqQTGguQ 98Kuw0vsesrWyDx2wU/e+GL73z3LE74hHp7PVgrya7usVphffWbJNypNuPCF+pwrLR/2JM 2NlqBe1xjnQxHhNtaH+zH96xA7bcwP4hY/dip+s2lVrdbTarLbO3fLLbVgh31A== 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 4Ly3424r2wzMgQ; Tue, 2 Aug 2022 18:12:18 +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 272ICIRW000573; Tue, 2 Aug 2022 18:12:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 272ICIJX000572; Tue, 2 Aug 2022 18:12:18 GMT (envelope-from git) Date: Tue, 2 Aug 2022 18:12:18 GMT Message-Id: <202208021812.272ICIJX000572@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: cc1ec77231d3 - main - Adjust g_waitidle() visibility and definition List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cc1ec77231d3caa4a46fd39b0b08afab6f2e687e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659463938; 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=0Mi6IF6yMsaGCyzkHnQGTKh8Nf/Wdnh0N6cZn0HblyY=; b=tGbohno59POcH0TkjKZgfYC4OaeenX0WtYN78dCzud6Xhex5hQdBkOo3xCP0XCwBeEQBLi 4JBjmgczujRL8oD8eCJ4uQZklsp6I9dIeVI6t0OklrSHgkqCEpWBfV++M0q8Gten35O9nT KoMgjEcTJ7IXkmBAeWGYu0GUvmpGN1lu/CxZtrKJtiF9cS9E9gfI61frhxua/6iA14jiSJ sKvBTY6xGiP5M+uBIdhTbnNeyBSd0NCLCOQvCMEOAOPiWnfj7H8B/otqZPG1gD+zsx7lGy hyxTbJmVaekG1CCIEcyPTb7nzw827R0MSg8fvw7l0KTz+wxRE5xlR/Ng4D9S4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659463938; a=rsa-sha256; cv=none; b=DL534sQmC1xJAQRNCh6wAYdVK5r118PpPoo+WIRsZZdu6YdmHfeMJsZCjur+kWW/k4sJA7 5bYhgIVc/cJ9VZ+MOyR+gft7Y26UbpF+RsQKxqwbgPiUeF8VQCPvxpDIJWA3FN6eiNbZMM pL8Bg5wyPpAV6B+rcUDWM5nzy/og1Xw8tnrTOuvxmj+IMGaY3FYZc+zZRJXoVI3t4UF8uf QU6dplIzPxuKeq17zm8EtJ+6VZpYniF7Kc+NwHubE/0AUaLut6zfh6jIVo9/eHDZwLdCyn LO7tWltmu1XuLhW+MqQHMAqYvk3lFcTHI4Z7LYM4ITp/saZ+FIoqGJwy2ELZlg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cc1ec77231d3caa4a46fd39b0b08afab6f2e687e commit cc1ec77231d3caa4a46fd39b0b08afab6f2e687e Author: Konstantin Belousov AuthorDate: 2022-07-22 08:00:18 +0000 Commit: Konstantin Belousov CommitDate: 2022-08-02 18:11:10 +0000 Adjust g_waitidle() visibility and definition Explicitly pass the struct thread argument. Move the function prototype from sys/systm.h to geom/geom.h, we do not need almost each kernel source to see the prototype, it is now used only by kern/vfs_mountroot.c outside geom/geom_event.c, where the function is defined. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D35888 --- sys/geom/geom.h | 2 ++ sys/geom/geom_event.c | 8 ++++---- sys/kern/vfs_mountroot.c | 8 +++++--- sys/sys/systm.h | 1 - 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/sys/geom/geom.h b/sys/geom/geom.h index a9990f669863..fa7cacc25f54 100644 --- a/sys/geom/geom.h +++ b/sys/geom/geom.h @@ -59,6 +59,7 @@ struct sbuf; struct gctl_req; struct g_configargs; struct disk_zone_args; +struct thread; typedef int g_config_t (struct g_configargs *ca); typedef void g_ctl_req_t (struct gctl_req *, struct g_class *cp, char const *verb); @@ -270,6 +271,7 @@ int g_media_gone(struct g_provider *pp, int flag); void g_orphan_provider(struct g_provider *pp, int error); struct g_event *g_alloc_event(int flag); void g_post_event_ep(g_event_t *func, void *arg, struct g_event *ep, ...); +void g_waitidle(struct thread *td); /* geom_subr.c */ int g_access(struct g_consumer *cp, int nread, int nwrite, int nexcl); diff --git a/sys/geom/geom_event.c b/sys/geom/geom_event.c index f14dfbe1cb54..824fe336fe14 100644 --- a/sys/geom/geom_event.c +++ b/sys/geom/geom_event.c @@ -81,7 +81,7 @@ struct g_event { #define EV_INPROGRESS 0x10000 void -g_waitidle(void) +g_waitidle(struct thread *td) { g_topology_assert_not(); @@ -93,17 +93,17 @@ g_waitidle(void) "g_waitidle", 0); TSUNWAIT("GEOM events"); mtx_unlock(&g_eventlock); - curthread->td_pflags &= ~TDP_GEOM; + td->td_pflags &= ~TDP_GEOM; } static void -ast_geom(struct thread *td __unused, int tda __unused) +ast_geom(struct thread *td, int tda __unused) { /* * If this thread tickled GEOM, we need to wait for the giggling to * stop before we return to userland. */ - g_waitidle(); + g_waitidle(td); } static void diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c index ddc9784109b7..1cf5efb6e57e 100644 --- a/sys/kern/vfs_mountroot.c +++ b/sys/kern/vfs_mountroot.c @@ -978,6 +978,7 @@ static void vfs_mountroot_wait(void) { struct root_hold_token *h; + struct thread *td; struct timeval lastfail; int curfail; @@ -986,8 +987,9 @@ vfs_mountroot_wait(void) curfail = 0; lastfail.tv_sec = 0; ppsratecheck(&lastfail, &curfail, 1); + td = curthread; while (1) { - g_waitidle(); + g_waitidle(td); mtx_lock(&root_holds_mtx); if (TAILQ_EMPTY(&root_holds)) { mtx_unlock(&root_holds_mtx); @@ -1004,7 +1006,7 @@ vfs_mountroot_wait(void) hz); TSUNWAIT("root mount"); } - g_waitidle(); + g_waitidle(td); TSEXIT(); } @@ -1030,7 +1032,7 @@ vfs_mountroot_wait_if_neccessary(const char *fs, const char *dev) * Note that we must wait for GEOM to finish reconfiguring itself, * eg for geom_part(4) to finish tasting. */ - g_waitidle(); + g_waitidle(curthread); if (parse_mount_dev_present(dev)) return (0); diff --git a/sys/sys/systm.h b/sys/sys/systm.h index e4d7a949945d..52ee592e9e4a 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -150,7 +150,6 @@ void *hashinit_flags(int count, struct malloc_type *type, void *phashinit(int count, struct malloc_type *type, u_long *nentries); void *phashinit_flags(int count, struct malloc_type *type, u_long *nentries, int flags); -void g_waitidle(void); void cpu_flush_dcache(void *, size_t); void cpu_rootconf(void);