From nobody Mon Feb 07 09:50:49 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 9E7A919C1152; Mon, 7 Feb 2022 09:50:51 +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 4JshGg0b5Qz3sLD; Mon, 7 Feb 2022 09:50:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644227451; 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=rdrGP8+idXFXJe5TYc4wP/IFZ1167w7qTMqW+fqh8CM=; b=G7a9+FXXh8Q7UMB0kQC3plv6K9CvSyrjl7PSIvhYe/K6G2kGnfdN39uQF1Gm7+x+2Cbh/Z hRWj9YN61flRzR7rGC9PpvfYC7l/GWxL/2PUokxMWGHGmsRLgBvriUr7GnkURqwayAFlAG hBce0ZSAipjyGvnd225CUz/wVJf5QNg/GPIlYNrTJs+HaCi9RCpLQZbp5U7dxPO49eATcC M/HfzrDU/jgpgdRSb/rCZHP0FLIaKax9D+993E0N5R3clBqXglAoWFNHeRQQku5FaXNcEj /WuGwj6mifMNMdPHNiOSBx2YAYIA+W8WzdtCnoJTDQxcsIsXN8DbbjIiPfceUQ== 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 0AA3C237AE; Mon, 7 Feb 2022 09:50:50 +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 2179onb3058958; Mon, 7 Feb 2022 09:50:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2179on4t058957; Mon, 7 Feb 2022 09:50:49 GMT (envelope-from git) Date: Mon, 7 Feb 2022 09:50:49 GMT Message-Id: <202202070950.2179on4t058957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 78d27f25c78a - stable/13 - Use dedicated lock name for pbufs 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 78d27f25c78afe5efd5b90120ca728f7be0c4d88 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644227451; 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=rdrGP8+idXFXJe5TYc4wP/IFZ1167w7qTMqW+fqh8CM=; b=RrwvPpqbrLIIeSGfzsqaL2do3zpzbBtWN3/l4Mqk2WnvXuSzDNxRhjWt0dOdL++VjJRB/Y Uh6M0Xwy6+2E635HffxhM73YB+VlzOBog3DH+FNvf/tAFQG47IbxO8MC4gR17hU4W+z8xD KeANoO2ioXlk1T1FcZK+aj7vXp4HadFEsu9jr3I70HaFRJh4J/ITLqe3N/csUXF4SfOb9I U3mQEPZx0t4N8zioWcehAc/m+m0+fYNnxqcxRDz+zMLrgZCb77EfI7o6CQSvFcnoucSiH/ md10Rr3wzFYSLgFRNhv0QjpUpzibv6I1mZmMhFzoy+NdwxlbRWJm6lj8Fjv/Lg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644227451; a=rsa-sha256; cv=none; b=DxsiPUNV5Yv335NFzYNwzSeriZPYhETCRH/Rkx95U82M0iHgLH6sQJnU8C7c5mX1aNrhMh AkU4nmSF5Qj6brC6zxj7EMZ2ypSibygl5sOLv2YHAIttQKIgOAnxSm3aW1kJnlcGtTml2e 5IJCCJp8qJO8bCHUTk+slobtv9vBJVQ3AujdCM2yhpgPDmjN+Nh8OVi54dAFuImdvH1JLe du64FGLM+Q8vyNlJwxpCE+Sdod81rowINgPc2I4+UAEfxaDia9Zb5lsGZV+Pf9JPfoG0wr th4kdBP8F7FW/mIircLkRdmsyPHqGANKEqpPmSxWnaZZqWPrEqQcaO8qRVS4Rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=78d27f25c78afe5efd5b90120ca728f7be0c4d88 commit 78d27f25c78afe5efd5b90120ca728f7be0c4d88 Author: Konstantin Belousov AuthorDate: 2022-01-23 00:24:12 +0000 Commit: Konstantin Belousov CommitDate: 2022-02-07 09:38:49 +0000 Use dedicated lock name for pbufs (cherry picked from commit 531f8cfea06b689b6c17219faa3e67977958b0c0) --- sys/kern/vfs_bio.c | 14 +++++++------- sys/sys/buf.h | 6 ++---- sys/vm/vm_pager.c | 4 +++- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index a3cec5d7ec74..aaf7b69d47db 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -400,12 +400,6 @@ struct bufqueue __exclusive_cache_line bqempty; */ uma_zone_t buf_zone; -/* - * Single global constant for BUF_WMESG, to avoid getting multiple references. - * buf_wmesg is referred from macros. - */ -const char *buf_wmesg = BUF_WMESG; - static int sysctl_runningspace(SYSCTL_HANDLER_ARGS) { @@ -1175,6 +1169,12 @@ kern_vfs_bio_buffer_alloc(caddr_t v, long physmem_est) return (v); } +/* + * Single global constant for BUF_WMESG, to avoid getting multiple + * references. + */ +static const char buf_wmesg[] = "bufwait"; + /* Initialize the buffer subsystem. Called before use of any buffers. */ void bufinit(void) @@ -1205,7 +1205,7 @@ bufinit(void) bp->b_xflags = 0; bp->b_data = bp->b_kvabase = unmapped_buf; LIST_INIT(&bp->b_dep); - BUF_LOCKINIT(bp); + BUF_LOCKINIT(bp, buf_wmesg); bq_insert(&bqempty, bp, false); } diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 86f5fbef7c92..e1b0450e2613 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -291,16 +291,14 @@ struct buf { /* * Buffer locking */ -extern const char *buf_wmesg; /* Default buffer lock message */ -#define BUF_WMESG "bufwait" #include /* XXX for curthread */ #include /* * Initialize a lock. */ -#define BUF_LOCKINIT(bp) \ - lockinit(&(bp)->b_lock, PRIBIO + 4, buf_wmesg, 0, LK_NEW) +#define BUF_LOCKINIT(bp, wmesg) \ + lockinit(&(bp)->b_lock, PRIBIO + 4, wmesg, 0, LK_NEW) /* * * Get a lock sleeping non-interruptably until it becomes available. diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index 791fc1ebfe11..d81e5ec8692d 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -480,6 +480,8 @@ pbuf_dtor(void *mem, int size, void *arg) BUF_UNLOCK(bp); } +static const char pbuf_wmesg[] = "pbufwait"; + static int pbuf_init(void *mem, int size, int flags) { @@ -489,7 +491,7 @@ pbuf_init(void *mem, int size, int flags) if (bp->b_kvabase == NULL) return (ENOMEM); bp->b_kvasize = ptoa(PBUF_PAGES); - BUF_LOCKINIT(bp); + BUF_LOCKINIT(bp, pbuf_wmesg); LIST_INIT(&bp->b_dep); bp->b_rcred = bp->b_wcred = NOCRED; bp->b_xflags = 0;