svn commit: r319208 - in user/pho/stress2: misc testcases/swap

Peter Holm pho at FreeBSD.org
Tue May 30 13:30:28 UTC 2017


Author: pho
Date: Tue May 30 13:30:26 2017
New Revision: 319208
URL: https://svnweb.freebsd.org/changeset/base/319208

Log:
  Stop the optimizer from removing code.
  
  Sponsored by:	Dell EMC Isilon

Modified:
  user/pho/stress2/misc/mmap4.sh
  user/pho/stress2/misc/stealer.sh
  user/pho/stress2/misc/swap.sh
  user/pho/stress2/misc/swap2.sh
  user/pho/stress2/testcases/swap/swap.c

Modified: user/pho/stress2/misc/mmap4.sh
==============================================================================
--- user/pho/stress2/misc/mmap4.sh	Tue May 30 13:26:37 2017	(r319207)
+++ user/pho/stress2/misc/mmap4.sh	Tue May 30 13:30:26 2017	(r319208)
@@ -88,7 +88,8 @@ main(int argc, char **argv)
 	int fd, ps;
 	void *p;
 	size_t len;
-	char *c, *path;
+	volatile char *c;
+	char *path;
 
 	p = (void *)STARTADDR;
 	len = ADRSPACE;

Modified: user/pho/stress2/misc/stealer.sh
==============================================================================
--- user/pho/stress2/misc/stealer.sh	Tue May 30 13:26:37 2017	(r319207)
+++ user/pho/stress2/misc/stealer.sh	Tue May 30 13:30:26 2017	(r319208)
@@ -88,7 +88,7 @@ handler(int i __unused)
 void
 stealer(int pages)
 {
-	char *c;
+	volatile char *c;
 	int i, page, size;
 
 	page = getpagesize();

Modified: user/pho/stress2/misc/swap.sh
==============================================================================
--- user/pho/stress2/misc/swap.sh	Tue May 30 13:26:37 2017	(r319207)
+++ user/pho/stress2/misc/swap.sh	Tue May 30 13:30:26 2017	(r319208)
@@ -99,7 +99,7 @@ setup(void)
 int
 test(void)
 {
-	char *c;
+	volatile char *c;
 	int page;
 	unsigned long i, j;
 	time_t start;
@@ -127,7 +127,7 @@ test(void)
 			}
 		}
 	}
-	free(c);
+	free((void *)c);
 
 	_exit(0);
 }

Modified: user/pho/stress2/misc/swap2.sh
==============================================================================
--- user/pho/stress2/misc/swap2.sh	Tue May 30 13:26:37 2017	(r319207)
+++ user/pho/stress2/misc/swap2.sh	Tue May 30 13:30:26 2017	(r319208)
@@ -124,7 +124,7 @@ setup(void)
 int
 test(void)
 {
-	char *c;
+	volatile char *c;
 	int page;
 	unsigned long i, j;
 	time_t start;
@@ -152,7 +152,7 @@ test(void)
 			}
 		}
 	}
-	free(c);
+	free((void *)c);
 
 	_exit(0);
 }

Modified: user/pho/stress2/testcases/swap/swap.c
==============================================================================
--- user/pho/stress2/testcases/swap/swap.c	Tue May 30 13:26:37 2017	(r319207)
+++ user/pho/stress2/testcases/swap/swap.c	Tue May 30 13:30:26 2017	(r319208)
@@ -117,7 +117,7 @@ test(void)
 	time_t start;
 	unsigned long i, oldsize;
 	int page;
-	char *c;
+	volatile char *c;
 
 	oldsize = size;
 	c = malloc(size);
@@ -142,7 +142,7 @@ test(void)
 			usleep(1000);
 #endif
 	}
-	free(c);
+	free((void *)c);
 
 	return (0);
 }


More information about the svn-src-user mailing list