svn commit: r253096 - user/pho/stress2/testcases/mmap
Peter Holm
pho at FreeBSD.org
Tue Jul 9 13:26:17 UTC 2013
Author: pho
Date: Tue Jul 9 13:26:17 2013
New Revision: 253096
URL: http://svnweb.freebsd.org/changeset/base/253096
Log:
Added missing resource reservation.
Sponsored by: EMC / Isilon storage division
Modified:
user/pho/stress2/testcases/mmap/mmap.c
Modified: user/pho/stress2/testcases/mmap/mmap.c
==============================================================================
--- user/pho/stress2/testcases/mmap/mmap.c Tue Jul 9 13:22:30 2013 (r253095)
+++ user/pho/stress2/testcases/mmap/mmap.c Tue Jul 9 13:26:17 2013 (r253096)
@@ -48,6 +48,32 @@ static char path[128];
int
setup(int nb)
{
+ int64_t bl;
+ int64_t in;
+ int64_t reserve_bl;
+ int64_t reserve_in;
+ int freespace;
+
+ if (nb == 0) {
+ getdf(&bl, &in);
+
+ /* Resource requirements: */
+ reserve_in = 2 * op->incarnations;
+ reserve_bl = 20480 * op->incarnations;
+ freespace = (reserve_bl <= bl && reserve_in <= in);
+ if (!freespace)
+ reserve_bl = reserve_in = 0;
+
+ if (op->verbose > 1)
+ printf("mmap(incarnations=%d). Free(%jdk, %jd), reserve(%jdk, %jd)\n",
+ op->incarnations, bl/1024, in, reserve_bl/1024, reserve_in);
+ reservedf(reserve_bl, reserve_in);
+ putval(freespace);
+ } else {
+ freespace = getval();
+ }
+ if (!freespace)
+ exit(0);
umask(0);
sprintf(path,"%s.%05d", getprogname(), getpid());
More information about the svn-src-user
mailing list