diff mbox

[4/7] volatile-test: Drop is_anon flag and extra handling

Message ID 1375133480-5597-5-git-send-email-john.stultz@linaro.org
State Accepted
Headers show

Commit Message

John Stultz July 29, 2013, 9:31 p.m. UTC
The is_anon bits were originally uses when we didn't have
the copy volatile ranges on fork working, so we can drop
this COW-breaking code now.

Signed-off-by: John Stultz <john.stultz@linaro.org>
---
 volatile-test-signal.c | 10 ----------
 volatile-test.c        | 10 ----------
 2 files changed, 20 deletions(-)
diff mbox

Patch

diff --git a/volatile-test-signal.c b/volatile-test-signal.c
index df2068f..4434525 100644
--- a/volatile-test-signal.c
+++ b/volatile-test-signal.c
@@ -43,7 +43,6 @@  static int mnovolatile(void *addr, size_t length, int* purged)
 
 
 char* vaddr;
-int is_anon = 0;
 #define PAGE_SIZE (4*1024)
 #define CHUNK (4*1024*4)
 #define CHUNKNUM 26
@@ -60,14 +59,6 @@  void generate_pressure(megs)
 
 
 	if (!child) {
-		if (is_anon) {
-			/* make sure we write to all the vrange pages
-			 *  in order to break the copy-on-write
-	 		 */
-			for(i=0; i < CHUNKNUM; i++)
-				memset(vaddr + (i*CHUNK), '0', CHUNK);
-		}
-
 		for (i=0; i < megs; i++) {
 			addr = malloc(one_meg);
 			bzero(addr, one_meg);		
@@ -129,7 +120,6 @@  int main(int argc, char *argv[])
 		fd = open(file, O_RDWR);
 		vaddr = mmap(0, FULLSIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
 	} else {
-		is_anon = 1;
 		vaddr = malloc(FULLSIZE);
 	}
 
diff --git a/volatile-test.c b/volatile-test.c
index e148e19..153bd6d 100644
--- a/volatile-test.c
+++ b/volatile-test.c
@@ -42,7 +42,6 @@  static int mnovolatile(void *addr, size_t length, int* purged)
 
 
 char* vaddr;
-int is_anon = 0;
 #define PAGE_SIZE (4*1024)
 #define CHUNK (4*1024*4)
 #define CHUNKNUM 26
@@ -59,14 +58,6 @@  void generate_pressure(megs)
 
 
 	if (!child) {
-		if (is_anon) {
-			/* make sure we write to all the vrange pages
-			 *  in order to break the copy-on-write
-	 		 */
-			for(i=0; i < CHUNKNUM; i++)
-				memset(vaddr + (i*CHUNK), '0', CHUNK);
-		}
-
 		for (i=0; i < megs; i++) {
 			addr = malloc(one_meg);
 			bzero(addr, one_meg);		
@@ -88,7 +79,6 @@  int main(int argc, char *argv[])
 		fd = open(file, O_RDWR);
 		vaddr = mmap(0, FULLSIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
 	} else {
-		is_anon = 1;
 		vaddr = malloc(FULLSIZE);
 	}