From nobody Tue Feb 01 04:55:09 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 835FA198F5F5; Tue, 1 Feb 2022 04:55:10 +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 4Jnt0F4G2jz3kWv; Tue, 1 Feb 2022 04:55:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643691309; 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=hqpUlZ5pa9QOI+foTKPuJmcSnLLMuyd8uWqq2XTjOrQ=; b=I1Mj7NdB9gJM9FUqqkNB2rTeWyJvCLluuhrMsnf6+78fTV2jk/mbdYv/1gi6nnSiRknWSN QzaToB4Ii9tPNW8HsyFyOGIISiAX+Ffr50SU9cjVLDfhusPvikoTmvi91A11hAP/YmNZ/g BFlA88lbMwNCJ0GNhLuNRHpVDGprEpnvD3FJKhttv+AoKA+Idl22rkCSLmbPQkF5CvbSV5 syo3pg5e19UJMLqum4hm+u1vM5xeFV+dBoFHOSzP+ayYFs/a1xjjHHuII5+15k7mJnJGe2 Tb6NLLjGJfJqYM+giV78pbDlcvaWwAQa07yP8cyRjdTj4cEFNNJQ6iUEOgm04A== 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 6D9C51DB5; Tue, 1 Feb 2022 04:55:09 +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 2114t97Y007893; Tue, 1 Feb 2022 04:55:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2114t95q007892; Tue, 1 Feb 2022 04:55:09 GMT (envelope-from git) Date: Tue, 1 Feb 2022 04:55:09 GMT Message-Id: <202202010455.2114t95q007892@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: c02780b78c7f - main - Add GB_NOWITNESS flag 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: c02780b78c7f1df3e682e1a88b380820c288ec04 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643691309; 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=hqpUlZ5pa9QOI+foTKPuJmcSnLLMuyd8uWqq2XTjOrQ=; b=prYscv8W06x7y2zg+TgWMMYYLyBBhKLkrNNXhyoZv+bFtg3Tg/dVcXv5spSQyg1ECv3EYA an7vH40eOfd8Im5jCpysRXIx3iERyng/2XIz5jgBpUTCAVQQC2QG8jKqLjBD2tnPJ1cv41 ztumOaor2eRfAipbJUyHBOqPioKbMIFI4BIrEV/hIbKachv3KRIu5/DTMyps8FlzXpIdW0 0sCl+7zvkGQw5Myv6+sp23AWj1LTUawHChZlHs4Ve2FQ2RfokOEvrRmpcRWpPWJ5OJEbxH p2QNFOepKYzNzxSPqWknpEEd2vK3Kqw4tuLKaSPGFbpcUxPG4N3r024oZ1TYtA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643691309; a=rsa-sha256; cv=none; b=WRLM600J8qM4nQvDxW1S1NCLOU1Gv2FHQWfxeS3uyTur9+ixlf2gGk6KqUIGwxZLCKAwn7 I/cIH/UToMA51gNhBm/2fLvpl+UKQ4/tW7WJ+S/i18uGyjW3Xb/7nLxNuqv7452pmUbPbv HguDj3UHVfAA8DCmKqeJWeX6JV1lqOHlK8GbsbPxlscHLhn6dlxLNWiGEbbx9bNZARt37e tTp40F+c54VlY2Gfsrqsl1pZlW7ZAacMdpej/1VEAB3g+FF8TJ8Ia1XXpQrRv5pczi/YGC +fx+AgL9q6n8MupTQmTbpI4E9vNenvFCb/6PrfU0V48LLGVDP37rYZMdf1KDDg== 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=c02780b78c7f1df3e682e1a88b380820c288ec04 commit c02780b78c7f1df3e682e1a88b380820c288ec04 Author: Konstantin Belousov AuthorDate: 2022-01-28 04:37:23 +0000 Commit: Konstantin Belousov CommitDate: 2022-02-01 04:54:50 +0000 Add GB_NOWITNESS flag It prevents WITNESS from recording the lock order for the buffer lock acquired by getblkx(). Reviewed by: mckusick Discussed with: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34073 --- sys/kern/vfs_bio.c | 5 ++++- sys/sys/buf.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index cdb080688874..af89f11a30f0 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -4003,7 +4003,10 @@ loop: * it must be on a queue. */ lockflags = LK_EXCLUSIVE | LK_INTERLOCK | - ((flags & GB_LOCK_NOWAIT) ? LK_NOWAIT : LK_SLEEPFAIL); + ((flags & GB_LOCK_NOWAIT) != 0 ? LK_NOWAIT : LK_SLEEPFAIL); +#ifdef WITNESS + lockflags |= (flags & GB_NOWITNESS) != 0 ? LK_NOWITNESS : 0; +#endif error = BUF_TIMELOCK(bp, lockflags, BO_LOCKPTR(bo), "getblk", slpflag, slptimeo); diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 8fb49fb1e7d1..fa930487235f 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -508,6 +508,7 @@ buf_track(struct buf *bp __unused, const char *location __unused) #define GB_CKHASH 0x0020 /* If reading, calc checksum hash */ #define GB_NOSPARSE 0x0040 /* Do not instantiate holes */ #define GB_CVTENXIO 0x0080 /* Convert errors to ENXIO */ +#define GB_NOWITNESS 0x0100 /* Do not record for WITNESS */ #ifdef _KERNEL extern int nbuf; /* The number of buffer headers */