Rev 1787 | Rev 2021 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1787 | Rev 2019 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | #include <mm/frame.h> |
35 | #include <mm/frame.h> |
36 | #include <memstr.h> |
36 | #include <memstr.h> |
37 | #include <synch/condvar.h> |
37 | #include <synch/condvar.h> |
38 | #include <synch/mutex.h> |
38 | #include <synch/mutex.h> |
39 | 39 | ||
- | 40 | #ifdef CONFIG_BENCH |
|
- | 41 | #include <arch/cycle.h> |
|
- | 42 | #endif |
|
- | 43 | ||
40 | #define ITEM_SIZE 256 |
44 | #define ITEM_SIZE 256 |
41 | 45 | ||
42 | /** Fill memory with 2 caches, when allocation fails, |
46 | /** Fill memory with 2 caches, when allocation fails, |
43 | * free one of the caches. We should have everything in magazines, |
47 | * free one of the caches. We should have everything in magazines, |
44 | * now allocation should clean magazines and allow for full allocation. |
48 | * now allocation should clean magazines and allow for full allocation. |
Line 206... | Line 210... | ||
206 | printf("Stress test complete.\n"); |
210 | printf("Stress test complete.\n"); |
207 | } |
211 | } |
208 | 212 | ||
209 | void test(void) |
213 | void test(void) |
210 | { |
214 | { |
- | 215 | #ifdef CONFIG_BENCH |
|
- | 216 | uint64_t t0 = get_cycle(); |
|
- | 217 | #endif |
|
- | 218 | ||
211 | printf("Running reclaim single-thread test .. pass1\n"); |
219 | printf("Running reclaim single-thread test .. pass1\n"); |
212 | totalmemtest(); |
220 | totalmemtest(); |
213 | printf("Running reclaim single-thread test .. pass2\n"); |
221 | printf("Running reclaim single-thread test .. pass2\n"); |
214 | totalmemtest(); |
222 | totalmemtest(); |
215 | printf("Reclaim test OK.\n"); |
223 | printf("Reclaim test OK.\n"); |
216 | 224 | ||
217 | multitest(128); |
225 | multitest(128); |
218 | multitest(2048); |
226 | multitest(2048); |
219 | multitest(8192); |
227 | multitest(8192); |
220 | printf("All done.\n"); |
228 | printf("All done.\n"); |
- | 229 | ||
- | 230 | #ifdef CONFIG_BENCH |
|
- | 231 | uint64_t dt = get_cycle() - t0; |
|
- | 232 | printf("Time: %.*d cycles\n", sizeof(dt) * 2, dt); |
|
- | 233 | #endif |
|
221 | } |
234 | } |