Browse Source

Evaluation of Jikes RVM write barrier

rebased_bqv2_avoid_if
Thomas Preud'homme 10 years ago
commit
57e12e8a9e

+ 32
- 0
jikes_write_barrier/Makefile View File

@@ -0,0 +1,32 @@
1
+CC=gcc
2
+
3
+INCDIR=include
4
+LIBDIR=lib
5
+SRCDIR=src
6
+BINDIR=bin
7
+PAPILIBDIR=lib
8
+PAPIINCDIR=include
9
+LOCALDIR=$(HOME)/local
10
+
11
+default: barrier
12
+
13
+# TODO: Verify libpapihighlevel.so is uptodate (need a git module)
14
+runbarrier: $(BINDIR)/lip6/jikesrvm/bench/Main.class $(BINDIR)/lip6/jikesrvm/bench/Cell.class
15
+	LD_LIBRARY_PATH=$(LOCALDIR)/$(LIBDIR) \
16
+		rvm -cp $(BINDIR):$(LOCALDIR)/$(LIBDIR) \
17
+		-Djava.library.path=$(LOCALDIR)/$(LIBDIR) \
18
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
19
+
20
+# TODO: Verify libpapihighlevel.so is uptodate (need a git module)
21
+barrier: $(BINDIR)/lip6/jikesrvm/bench/Main.class
22
+
23
+$(BINDIR)/lip6/jikesrvm/bench/Main.class: $(SRCDIR)/lip6/jikesrvm/bench/Main.java \
24
+		$(SRCDIR)/lip6/jikesrvm/bench/Cell.java
25
+	if [ ! -d $(BINDIR) ] ; then mkdir $(BINDIR) ; fi
26
+	javac -d $(BINDIR) -sourcepath $(SRCDIR) -classpath $(LOCALDIR)/$(PAPILIBDIR) \
27
+		$(SRCDIR)/lip6/jikesrvm/bench/Main.java
28
+
29
+clean:
30
+
31
+distclean: clean
32
+	rm -rf $(BINDIR)

+ 0
- 0
jikes_write_barrier/logs/with_ints_with_barrier_bubble_sort View File


+ 130
- 0
jikes_write_barrier/logs/with_refs_with_barrier_bubble_sort View File

@@ -0,0 +1,130 @@
1
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
2
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
3
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
4
+External GC trigger
5
+ctr: 129488718
6
+5 counters available
7
+Micro benchmark results
8
+
9
+L1 data cache hits : 7856225986
10
+L1 data cache misses : 42593429
11
+Total cycles : 6260581022
12
+Instructions completed : 9057772365
13
+----------------------------------------
14
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
15
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
16
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
17
+External GC trigger
18
+ctr: 129488718
19
+5 counters available
20
+Micro benchmark results
21
+
22
+L1 data cache hits : 12721192971
23
+L1 data cache misses : 41629055
24
+Total cycles : 9780090157
25
+Instructions completed : 12523198682
26
+----------------------------------------
27
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
28
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
29
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
30
+External GC trigger
31
+ctr: 129488718
32
+5 counters available
33
+Micro benchmark results
34
+
35
+L1 data cache hits : 11474503806
36
+L1 data cache misses : 42830433
37
+Total cycles : 8951950593
38
+Instructions completed : 11484713722
39
+----------------------------------------
40
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
41
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
42
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
43
+External GC trigger
44
+ctr: 129488718
45
+5 counters available
46
+Micro benchmark results
47
+
48
+L1 data cache hits : 9514624449
49
+L1 data cache misses : 34979841
50
+Total cycles : 7425253337
51
+Instructions completed : 10679950087
52
+----------------------------------------
53
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
54
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
55
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
56
+External GC trigger
57
+ctr: 129488718
58
+5 counters available
59
+Micro benchmark results
60
+
61
+L1 data cache hits : 10442613966
62
+L1 data cache misses : 38535204
63
+Total cycles : 8110421986
64
+Instructions completed : 11022285865
65
+----------------------------------------
66
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
67
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
68
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
69
+External GC trigger
70
+ctr: 129488718
71
+5 counters available
72
+Micro benchmark results
73
+
74
+L1 data cache hits : 9649352140
75
+L1 data cache misses : 38506204
76
+Total cycles : 7514358306
77
+Instructions completed : 10630749654
78
+----------------------------------------
79
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
80
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
81
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
82
+External GC trigger
83
+ctr: 129488718
84
+5 counters available
85
+Micro benchmark results
86
+
87
+L1 data cache hits : 9289193839
88
+L1 data cache misses : 34984514
89
+Total cycles : 7221152833
90
+Instructions completed : 10373551902
91
+----------------------------------------
92
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
93
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
94
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
95
+External GC trigger
96
+ctr: 129488718
97
+5 counters available
98
+Micro benchmark results
99
+
100
+L1 data cache hits : 9520818409
101
+L1 data cache misses : 34995452
102
+Total cycles : 7392555360
103
+Instructions completed : 10429643060
104
+----------------------------------------
105
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
106
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
107
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
108
+External GC trigger
109
+ctr: 129488718
110
+5 counters available
111
+Micro benchmark results
112
+
113
+L1 data cache hits : 7859458194
114
+L1 data cache misses : 43621319
115
+Total cycles : 6264774698
116
+Instructions completed : 8993231118
117
+----------------------------------------
118
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
119
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
120
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
121
+External GC trigger
122
+ctr: 129488718
123
+5 counters available
124
+Micro benchmark results
125
+
126
+L1 data cache hits : 8325810164
127
+L1 data cache misses : 43757821
128
+Total cycles : 6598387097
129
+Instructions completed : 9159926435
130
+----------------------------------------

+ 130
- 0
jikes_write_barrier/logs/with_refs_without_barrier_bubble_sort View File

@@ -0,0 +1,130 @@
1
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
2
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
3
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
4
+External GC trigger
5
+ctr: 129488718
6
+5 counters available
7
+Micro benchmark results
8
+
9
+L1 data cache hits : 4151666153
10
+L1 data cache misses : 40965208
11
+Total cycles : 3365296666
12
+Instructions completed : 4346635736
13
+----------------------------------------
14
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
15
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
16
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
17
+External GC trigger
18
+ctr: 129488718
19
+5 counters available
20
+Micro benchmark results
21
+
22
+L1 data cache hits : 5628905554
23
+L1 data cache misses : 40795770
24
+Total cycles : 4399927753
25
+Instructions completed : 5564704630
26
+----------------------------------------
27
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
28
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
29
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
30
+External GC trigger
31
+ctr: 129488718
32
+5 counters available
33
+Micro benchmark results
34
+
35
+L1 data cache hits : 4925354924
36
+L1 data cache misses : 40646528
37
+Total cycles : 3929536007
38
+Instructions completed : 4892870645
39
+----------------------------------------
40
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
41
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
42
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
43
+External GC trigger
44
+ctr: 129488718
45
+5 counters available
46
+Micro benchmark results
47
+
48
+L1 data cache hits : 5066394247
49
+L1 data cache misses : 40725993
50
+Total cycles : 4029236766
51
+Instructions completed : 5150101365
52
+----------------------------------------
53
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
54
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
55
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
56
+External GC trigger
57
+ctr: 129488718
58
+5 counters available
59
+Micro benchmark results
60
+
61
+L1 data cache hits : 4920983789
62
+L1 data cache misses : 40797101
63
+Total cycles : 3905129448
64
+Instructions completed : 4884638623
65
+----------------------------------------
66
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
67
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
68
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
69
+External GC trigger
70
+ctr: 129488718
71
+5 counters available
72
+Micro benchmark results
73
+
74
+L1 data cache hits : 4196239158
75
+L1 data cache misses : 41002264
76
+Total cycles : 3403407318
77
+Instructions completed : 4390931430
78
+----------------------------------------
79
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
80
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
81
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
82
+External GC trigger
83
+ctr: 129488718
84
+5 counters available
85
+Micro benchmark results
86
+
87
+L1 data cache hits : 5278645240
88
+L1 data cache misses : 40797406
89
+Total cycles : 4156122895
90
+Instructions completed : 5269032940
91
+----------------------------------------
92
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
93
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
94
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
95
+External GC trigger
96
+ctr: 129488718
97
+5 counters available
98
+Micro benchmark results
99
+
100
+L1 data cache hits : 4900301670
101
+L1 data cache misses : 40987116
102
+Total cycles : 3923845888
103
+Instructions completed : 4930424189
104
+----------------------------------------
105
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
106
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
107
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
108
+External GC trigger
109
+ctr: 129488718
110
+5 counters available
111
+Micro benchmark results
112
+
113
+L1 data cache hits : 5441093146
114
+L1 data cache misses : 40741140
115
+Total cycles : 4284213216
116
+Instructions completed : 5487664108
117
+----------------------------------------
118
+LD_LIBRARY_PATH=/home/robotux/local/lib:/home/robotux/Projects/lip6/papi/lib \
119
+		rvm -cp barrier/bin -Djava.library.path=/home/robotux/Projects/lip6/papi/lib \
120
+		-Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main
121
+External GC trigger
122
+ctr: 129488718
123
+5 counters available
124
+Micro benchmark results
125
+
126
+L1 data cache hits : 5560405377
127
+L1 data cache misses : 37920909
128
+Total cycles : 4370396702
129
+Instructions completed : 5637877960
130
+----------------------------------------

+ 55
- 0
jikes_write_barrier/src/lip6/jikesrvm/bench/Cell.java View File

@@ -0,0 +1,55 @@
1
+package lip6.jikesrvm.bench;
2
+
3
+public class Cell
4
+{
5
+	private static long ctr;
6
+	private int value;
7
+	private Cell next;
8
+	private Cell prev;
9
+
10
+	static
11
+	{
12
+		ctr = 0;
13
+	}
14
+
15
+	public Cell getNext()
16
+	{
17
+		return this.next;
18
+	}
19
+
20
+	public void setNext(Cell next)
21
+	{
22
+		this.next = next;
23
+	}
24
+
25
+	public Cell getPrev()
26
+	{
27
+		return this.prev;
28
+	}
29
+
30
+	public void setPrev(Cell prev)
31
+	{
32
+		this.prev = prev;
33
+	}
34
+
35
+	public int getValue()
36
+	{
37
+		return this.value;
38
+	}
39
+
40
+	public Cell(int val)
41
+	{
42
+		this.value = val;
43
+	}
44
+
45
+	public static void incCounter(int val)
46
+	{
47
+		ctr += val;
48
+	}
49
+
50
+	public static long getCounter()
51
+	{
52
+		return ctr;
53
+	}
54
+};
55
+

+ 98
- 0
jikes_write_barrier/src/lip6/jikesrvm/bench/Main.java View File

@@ -0,0 +1,98 @@
1
+package lip6.jikesrvm.bench;
2
+
3
+import java.util.Random;
4
+import lip6.jikesrvm.bench.Cell;
5
+import lip6.microbenchs.PapiHighLevel;
6
+
7
+public class Main
8
+{
9
+	private static final long NB_ELEM = 10000;
10
+	private static Random randomInt; // random int to put into the cells
11
+	private static Cell head;
12
+
13
+	static
14
+	{
15
+		System.loadLibrary("papihighlevel");
16
+	}
17
+
18
+	public static void main(String args[])
19
+	{
20
+		randomInt = new Random(424242424242L);
21
+		{
22
+			Cell oldCell, newCell;
23
+
24
+			newCell = null;
25
+			head = new Cell(randomInt.nextInt());
26
+			oldCell = head;
27
+			for (int i = 0; i < NB_ELEM - 1; i++)
28
+			{
29
+				if (i == NB_ELEM / 2)
30
+					Runtime.getRuntime().gc();
31
+				newCell = new Cell(randomInt.nextInt());
32
+				newCell.setPrev(oldCell);
33
+				oldCell.setNext(newCell);
34
+				oldCell = newCell;
35
+			}
36
+			newCell.setNext(head);
37
+			head.setPrev(newCell);
38
+		}
39
+		if (PapiHighLevel.initialize_papi() != 0)
40
+		{
41
+			System.err.println("Error while inizializing PAPI");
42
+			java.lang.System.exit(1);
43
+			return;
44
+		}
45
+		bubbleSort();
46
+		if (PapiHighLevel.print_results() != 0)
47
+		{
48
+			System.err.println("Error while getting results");
49
+			java.lang.System.exit(2);
50
+			return;
51
+		}
52
+	}
53
+
54
+	private static void bubbleSort()
55
+	{
56
+		Cell cell, nextCell;
57
+
58
+		/* We suppose the list disordered */
59
+		boolean ordered = false;
60
+
61
+		/* We stop after NB_ELEM loop or if a loop has been done without inversion */
62
+		for(int i = 0 ; (i < NB_ELEM) && !ordered; i++)
63
+		{
64
+			/* We suppose the list ordered */
65
+			ordered = true;
66
+
67
+			/* New tracing of the list: we start to examine the first 2 cells */
68
+			cell = head;
69
+			nextCell = cell.getNext();
70
+			for(int j = 1 ;j < NB_ELEM - i; j++)
71
+			{
72
+				/* If the 2 cells aren't ordered */
73
+				if (nextCell.getValue() < cell.getValue())
74
+				{
75
+					/* We invert the 2 cells */
76
+					cell.getPrev().setNext(nextCell);
77
+					nextCell.getNext().setPrev(cell);
78
+					cell.setNext(nextCell.getNext());
79
+					nextCell.setPrev(cell.getPrev());
80
+					cell.setPrev(nextCell);
81
+					nextCell.setNext(cell);
82
+					Cell.incCounter(6);
83
+
84
+
85
+					/* We made an inversion: the list isn't ordered */
86
+					ordered = false;
87
+				}
88
+				else
89
+					cell = nextCell; /* Get ready for the next loop: we make a one cell shift (1) */
90
+
91
+				/* Get ready for the next loop: we make a one cell shift (2) */
92
+				nextCell = cell.getNext();
93
+			}
94
+		}
95
+		System.out.println("ctr: " + Cell.getCounter());
96
+	}
97
+};
98
+

Loading…
Cancel
Save