svn commit: r366601 - user/pho/stress2/misc
Peter Holm
pho at FreeBSD.org
Sat Oct 10 08:02:24 UTC 2020
Author: pho
Date: Sat Oct 10 08:02:23 2020
New Revision: 366601
URL: https://svnweb.freebsd.org/changeset/base/366601
Log:
Handle sysctl name change from 'vm.max_wired' to 'vm.max_user_wired'.
Handle sysent.h changes.
Modified:
user/pho/stress2/misc/contigmalloc.sh
user/pho/stress2/misc/contigmalloc2.sh
user/pho/stress2/misc/contigmalloc3.sh
Modified: user/pho/stress2/misc/contigmalloc.sh
==============================================================================
--- user/pho/stress2/misc/contigmalloc.sh Sat Oct 10 07:20:59 2020 (r366600)
+++ user/pho/stress2/misc/contigmalloc.sh Sat Oct 10 08:02:23 2020 (r366601)
@@ -92,7 +92,7 @@ test(int argc, char *argv[])
ps = getpagesize();
s = 0;
n = arc4random() % N + 1;
- mw = mw / 100 * 10 * ps; /* Use 10% of vm.max_wired */
+ mw = mw / 100 * 10 * ps; /* Use 10% of vm.max_user_wired */
mw = min(mw, CAP);
for (i = 0; i < n; i++) {
size[i] = round_page((arc4random() % MAXBUF) + 1);
@@ -102,6 +102,7 @@ test(int argc, char *argv[])
if (res == -1) {
warn("contigmalloc(%lu pages) failed at loop %d",
size[i] / ps, i);
+ usleep(200000);
} else {
#if defined(TEST)
fprintf(stderr, "contigmalloc(%lu pages)\n",
@@ -154,7 +155,7 @@ make || exit 1
kldload $dir/cmalloc.ko || exit 1
cd $odir
-mw=`sysctl -n vm.max_wired` || exit 1
+mw=`sysctl -n vm.max_user_wired` || exit 1
/tmp/ctest `sysctl -n debug.cmalloc_offset` $mw 2>&1 | tail -5
kldunload $dir/cmalloc.ko
rm -rf $dir /tmp/ctest
@@ -219,8 +220,8 @@ cmalloc(struct thread *td, struct cmalloc_args *uap)
* The sysent for the new syscall
*/
static struct sysent cmalloc_sysent = {
- 3, /* sy_narg */
- (sy_call_t *) cmalloc /* sy_call */
+ .sy_narg = 3, /* sy_narg */
+ .sy_call = (sy_call_t *) cmalloc /* sy_call */
};
/*
Modified: user/pho/stress2/misc/contigmalloc2.sh
==============================================================================
--- user/pho/stress2/misc/contigmalloc2.sh Sat Oct 10 07:20:59 2020 (r366600)
+++ user/pho/stress2/misc/contigmalloc2.sh Sat Oct 10 08:02:23 2020 (r366601)
@@ -75,7 +75,7 @@ test(int argc, char *argv[])
errx(1, "Usage: %s <syscall number> <max wired>", argv[0]);
ps = getpagesize();
- size = mw / 100 * 80 * ps; /* Use 80% of vm.max_wired */
+ size = mw / 100 * 80 * ps; /* Use 80% of vm.max_user_wired */
while (size > 0) {
res = syscall(no, TALLOC, &p, &size);
if (res == -1) {
@@ -122,8 +122,8 @@ make depend all || exit 1
kldload $dir/cmalloc2.ko || exit 1
cd $odir
-mw=$((`sysctl -n vm.max_wired` - `sysctl -n vm.stats.vm.v_wire_count`)) ||
- exit 1
+mw=$((`sysctl -n vm.max_user_wired` - \
+ `sysctl -n vm.stats.vm.v_user_wire_count`)) || exit 1
/tmp/ctest2 `sysctl -n debug.cmalloc_offset` $mw #2>&1 | tail -5
kldunload $dir/cmalloc2.ko
rm -rf $dir /tmp/ctest2
@@ -188,8 +188,8 @@ cmalloc(struct thread *td, struct cmalloc_args *uap)
* The sysent for the new syscall
*/
static struct sysent cmalloc_sysent = {
- 3, /* sy_narg */
- (sy_call_t *) cmalloc /* sy_call */
+ .sy_narg = 3, /* sy_narg */
+ .sy_call = (sy_call_t *) cmalloc /* sy_call */
};
/*
Modified: user/pho/stress2/misc/contigmalloc3.sh
==============================================================================
--- user/pho/stress2/misc/contigmalloc3.sh Sat Oct 10 07:20:59 2020 (r366600)
+++ user/pho/stress2/misc/contigmalloc3.sh Sat Oct 10 08:02:23 2020 (r366601)
@@ -76,7 +76,7 @@ test(int argc, char *argv[])
ps = getpagesize();
if (mw < MAXBUF / ps) {
- fprintf(stderr, "max_wired too small for this test\n");
+ fprintf(stderr, "max_user_wired too small for this test\n");
exit (0);
}
i = 0;
@@ -125,7 +125,7 @@ make || exit 1
kldload $dir/cmalloc.ko || exit 1
cd $odir
-mw=`sysctl -n vm.max_wired` || exit 1
+mw=`sysctl -n vm.max_user_wired` || exit 1
/tmp/ctest `sysctl -n debug.cmalloc_offset` $mw 2>&1 | tail -5
kldunload $dir/cmalloc.ko
rm -rf $dir /tmp/ctest
@@ -190,8 +190,8 @@ cmalloc(struct thread *td, struct cmalloc_args *uap)
* The sysent for the new syscall
*/
static struct sysent cmalloc_sysent = {
- 3, /* sy_narg */
- (sy_call_t *) cmalloc /* sy_call */
+ .sy_narg = 3, /* sy_narg */
+ .sy_call = (sy_call_t *) cmalloc /* sy_call */
};
/*
More information about the svn-src-user
mailing list