From nobody Sun Apr 21 12:25:26 2024 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 4VMndz02XDz5J77f; Sun, 21 Apr 2024 12:25:27 +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 4VMndy6TlTz56s5; Sun, 21 Apr 2024 12:25:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713702326; 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=X5QEuhM4+wmrlvTmZWmjBneH4ii6OIC7D1wbKhJlnWI=; b=daS8nkCvbvHZ69V2NPoCBn5FdU+BcPVgSV2QGxldmlLjAZNFTO4+eA97A2kDk8W6R06hoC 7os4X68pPUSAqwIEsb6XWYaqgGhHXWoXhr9NCtft22hpb+oEHhIYEnv/5hRDSv7if9ykY7 k2rYdOfMS/Gu9mgmbxZa7IsAlwo6sTGIabFiIHqbtu9yq6sgXn2qZSLUI1Gi0PxFgcP8B0 oW+AORbU+4S9Zs72Y0k/4Qc1KfZEw9v7E1lYclqk0N0U6VyhIvcQ6c471FZqr4rMTB9jrB m2mJ35VEDeELtXR3MkA4v2CWKjT/XAz2BztTMESwaLCBuEvbcs2AILT1DaqtLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713702326; a=rsa-sha256; cv=none; b=osbbMWdY33xHm8ZMTs2AAeVu2Zuhcm3LPeRANYn/BPKcVwDoNB4Dr5hHh7EHDyaxoAuBVR SYLlaWYJxt0LILoW9JIQlfZlAXg3jRKfeLKSJ/+V/1zyDwkJOKsTbqGaETp3vsgqATNHXj WwhScXfE8WZXoBYDlsn7sR4iqXzPBqpqU7xkc60IGcvPb8SH+523pyq9MYw5RuJ7P17Fsc Q+bBpCBBcndCIywJVnMd8suP31uRcZ7ZW/IaWc29GYDgjXYF0utRkP0mdnaKPpVOV1ywK2 ndlqHp0CXq4HsMY+jj7upfiquXFiLiBnNTQwYR4VOstjfz1YeGPeIsOi35D8Jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713702326; 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=X5QEuhM4+wmrlvTmZWmjBneH4ii6OIC7D1wbKhJlnWI=; b=KnoAom+eF97QVmilHQP/TKHzGTh4BKgmx4/Es2Jbtvszd22POnlWUKEWbH/Us4IYdhyJ2l H9Ubam3ZinzS9r3UfeBBSo6CotKRSMmyxo+Bbpc3LHECt6uziTnuGSzdpfQg5lRwANV5GZ GYbYieGSdzPTlB8lvtp5DbIWgI9essMMtl/J5vjhhjA5ceCfnnJH/uLYc9JHex+eL3XAmC ELU1OILNSdB13JnqhOjRt1v83q8wwEQHz6winpbz2xwyS1NO9PN4TDfNa29p1WLgP2ks6I JJUaCg3pc/onEgOIgGJ+KNPwoBjJKeNxKQjf/0hKy6amIkttH1Z/4411xwHMvQ== 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 4VMndy65rQz1JVQ; Sun, 21 Apr 2024 12:25:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43LCPQq4049600; Sun, 21 Apr 2024 12:25:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43LCPQHp049597; Sun, 21 Apr 2024 12:25:26 GMT (envelope-from git) Date: Sun, 21 Apr 2024 12:25:26 GMT Message-Id: <202404211225.43LCPQHp049597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: b9827c007a7a - main - Revert "dtrace: make 'ring' and 'fill' policies imply 'noswitch' 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9827c007a7a39c7aeef73f8efc217b7b0099464 Auto-Submitted: auto-generated The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=b9827c007a7a39c7aeef73f8efc217b7b0099464 commit b9827c007a7a39c7aeef73f8efc217b7b0099464 Author: Andriy Gapon AuthorDate: 2024-04-21 10:07:36 +0000 Commit: Andriy Gapon CommitDate: 2024-04-21 12:17:08 +0000 Revert "dtrace: make 'ring' and 'fill' policies imply 'noswitch' flag" This reverts commit e92491d95ff3500e140eafa614e88ca84ffb0d26. The general idea looked good to me. In particular, it allowed to save some memory and avoid memory allocation failures when a large buffer size was requested along with ring and fill policies. But I didn't take into account that the second, supposedly unused buffer, was actually used as the scratch buffer. The scratch buffer is used as a temporary space for DTrace subroutines like copyin, copyinstr, and alloca. I think that the change can be fixed by allocating a separate smaller buffer for the scratch buffer, but that fix would require more work than I am able to do now. Hence the revert. Reported by: Domagoj Stolfa Diagnosed by: Domagoj Stolfa, markj MFC after: immediately --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 83c0648b23b1..ce02676e0dc1 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -12058,6 +12058,7 @@ dtrace_buffer_switch(dtrace_buffer_t *buf) hrtime_t now; ASSERT(!(buf->dtb_flags & DTRACEBUF_NOSWITCH)); + ASSERT(!(buf->dtb_flags & DTRACEBUF_RING)); cookie = dtrace_interrupt_disable(); now = dtrace_gethrtime(); @@ -14865,10 +14866,10 @@ dtrace_state_buffer(dtrace_state_t *state, dtrace_buffer_t *buf, int which) if (which == DTRACEOPT_BUFSIZE) { if (opt[DTRACEOPT_BUFPOLICY] == DTRACEOPT_BUFPOLICY_RING) - flags |= DTRACEBUF_RING | DTRACEBUF_NOSWITCH; + flags |= DTRACEBUF_RING; if (opt[DTRACEOPT_BUFPOLICY] == DTRACEOPT_BUFPOLICY_FILL) - flags |= DTRACEBUF_FILL | DTRACEBUF_NOSWITCH; + flags |= DTRACEBUF_FILL; if (state != dtrace_anon.dta_state || state->dts_activity != DTRACE_ACTIVITY_ACTIVE)