aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2024-07-23 19:21:17 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2024-07-26 10:45:01 +0000
commitd1bdc2821fcd416ab9b238580386eb605a6128d0 (patch)
tree3d0be79e25a87ae24b1e36700d06dfd86009ebbb /tools
parent5b8c01d13a0970b11f47503fcd627d249a6e638a (diff)
downloadsrc-d1bdc2821fcd416ab9b238580386eb605a6128d0.tar.gz
src-d1bdc2821fcd416ab9b238580386eb605a6128d0.zip
Deprecate contigfree(9) in favour of free(9)
As of 9e6544dd6e02c46b805d11ab925c4f3b18ad7a4b contigfree(9) is no longer needed and should not be used anymore. We leave a wrapper for 3rd party code in at least 15.x but remove (almost) all other cases from the tree. This leaves one use of contigfree(9) untouched; that was the original trigger for 9e6544dd6e02 and is handled in D45813 (to be committed seperately later). Sponsored by: The FreeBSD Foundation Reviewed by: markj, kib Tested by: pho (10h stress test run) Differential Revision: https://reviews.freebsd.org/D46099
Diffstat (limited to 'tools')
-rwxr-xr-xtools/test/stress2/misc/contigmalloc.sh10
-rwxr-xr-xtools/test/stress2/misc/contigmalloc2.sh11
-rwxr-xr-xtools/test/stress2/misc/contigmalloc3.sh10
3 files changed, 12 insertions, 19 deletions
diff --git a/tools/test/stress2/misc/contigmalloc.sh b/tools/test/stress2/misc/contigmalloc.sh
index 92bf6ff40905..abaa2c3cad53 100755
--- a/tools/test/stress2/misc/contigmalloc.sh
+++ b/tools/test/stress2/misc/contigmalloc.sh
@@ -26,7 +26,7 @@
# SUCH DAMAGE.
#
-# contigmalloc(9) / contigfree(9) test scenario.
+# contigmalloc(9) / free(9) test scenario.
# malloc() a random number of buffers with random size and then free them.
# A malloc pattern might look like this:
@@ -116,7 +116,7 @@ test(int argc, char *argv[])
if (p[i] != NULL) {
res = syscall(no, TFREE, &p[i], &size[i]);
#if defined(TEST)
- fprintf(stderr, "contigfree(%lu pages)\n",
+ fprintf(stderr, "free(%lu pages)\n",
size[i] / ps);
#endif
p[i] = NULL;
@@ -197,10 +197,8 @@ cmalloc(struct thread *td, struct cmalloc_args *uap)
switch (uap->a_op) {
case TFREE:
error = copyin(uap->a_ptr, &p, sizeof(p));
- if (error == 0) {
- if (p != NULL)
- contigfree(p, size, M_TEMP);
- }
+ if (error == 0)
+ free(p, M_TEMP);
return (error);
case TALLOC:
diff --git a/tools/test/stress2/misc/contigmalloc2.sh b/tools/test/stress2/misc/contigmalloc2.sh
index e3ec5bf3a358..dd4bbd751fd4 100755
--- a/tools/test/stress2/misc/contigmalloc2.sh
+++ b/tools/test/stress2/misc/contigmalloc2.sh
@@ -26,7 +26,7 @@
# SUCH DAMAGE.
#
-# contigmalloc(9) / contigfree(9) test scenario.
+# contigmalloc(9) / free(9) test scenario.
# Regression test for allocations >= 2 GiB.
# "panic: vm_page_insert_after: mpred doesn't precede pindex" seen.
# Fixed by r284207.
@@ -87,8 +87,7 @@ test(int argc, char *argv[])
#endif
res = syscall(no, TFREE, &p, &size);
#if defined(TEST)
- fprintf(stderr, "contigfree(%lu pages)\n",
- size);
+ fprintf(stderr, "free(%lu pages)\n", size);
#endif
}
size /= 2;
@@ -165,10 +164,8 @@ cmalloc(struct thread *td, struct cmalloc_args *uap)
switch (uap->a_op) {
case TFREE:
error = copyin(uap->a_ptr, &p, sizeof(p));
- if (error == 0) {
- if (p != NULL)
- contigfree(p, size, M_TEMP);
- }
+ if (error == 0)
+ free(p, M_TEMP);
return (error);
case TALLOC:
diff --git a/tools/test/stress2/misc/contigmalloc3.sh b/tools/test/stress2/misc/contigmalloc3.sh
index 9baf7c129688..28d5c17e0566 100755
--- a/tools/test/stress2/misc/contigmalloc3.sh
+++ b/tools/test/stress2/misc/contigmalloc3.sh
@@ -26,7 +26,7 @@
# SUCH DAMAGE.
#
-# contigmalloc(9) / contigfree(9) test scenario.
+# contigmalloc(9) / free(9) test scenario.
# Test allocation with 1GB
# "panic: Bad link elm 0x6766fbc next->prev != elm" seen:
@@ -91,7 +91,7 @@ test(int argc, char *argv[])
res = syscall(no, TFREE, &cp, &size);
#if defined(TEST)
- fprintf(stderr, "contigfree(%lu pages) %luMB\n",
+ fprintf(stderr, "free(%lu pages) %luMB\n",
size / ps, size / 1024 / 1024);
#endif
}
@@ -166,10 +166,8 @@ cmalloc(struct thread *td, struct cmalloc_args *uap)
switch (uap->a_op) {
case TFREE:
error = copyin(uap->a_ptr, &p, sizeof(p));
- if (error == 0) {
- if (p != NULL)
- contigfree(p, size, M_TEMP);
- }
+ if (error == 0)
+ free(p, M_TEMP);
return (error);
case TALLOC: