Changeset 96348adc in mainline for kernel/test/mm/slab2.c
- Timestamp:
- 2006-12-12T17:24:58Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7e13972
- Parents:
- 34db7fa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/mm/slab2.c
r34db7fa r96348adc 38 38 #include <synch/mutex.h> 39 39 40 #ifdef CONFIG_BENCH41 #include <arch/cycle.h>42 #endif43 44 40 #define ITEM_SIZE 256 45 41 … … 78 74 olddata1 = data1; 79 75 olddata2 = data2; 80 } while(1);76 } while(1); 81 77 printf("done.\n"); 82 78 /* We do not have memory - now deallocate cache2 */ … … 129 125 static void slabtest(void *priv) 130 126 { 131 void *data =NULL, *new;127 void *data = NULL, *new; 132 128 133 129 thread_detach(THREAD); … … 173 169 } 174 170 175 176 171 printf("Thread #%d finished\n", THREAD->tid); 177 172 slab_print_list(); 178 173 semaphore_up(&thr_sem); 179 174 } 180 181 175 182 176 static void multitest(int size) … … 196 190 0); 197 191 semaphore_initialize(&thr_sem,0); 198 for (i =0; i<THREADS; i++) {192 for (i = 0; i < THREADS; i++) { 199 193 if (!(t = thread_create(slabtest, NULL, TASK, 0, "slabtest"))) 200 panic("could not create thread\n"); 201 thread_ready(t); 194 printf("Could not create thread %d\n", i); 195 else 196 thread_ready(t); 202 197 } 203 198 thread_sleep(1); 204 199 condvar_broadcast(&thread_starter); 205 200 206 for (i =0; i<THREADS; i++)201 for (i = 0; i < THREADS; i++) 207 202 semaphore_down(&thr_sem); 208 203 … … 211 206 } 212 207 213 void test_slab2(void) 214 { 215 #ifdef CONFIG_BENCH 216 uint64_t t0 = get_cycle(); 217 #endif 218 219 printf("Running reclaim single-thread test .. pass1\n"); 208 char * test_slab2(void) 209 { 210 printf("Running reclaim single-thread test .. pass 1\n"); 220 211 totalmemtest(); 221 printf("Running reclaim single-thread test .. pass 2\n");212 printf("Running reclaim single-thread test .. pass 2\n"); 222 213 totalmemtest(); 223 214 printf("Reclaim test OK.\n"); … … 227 218 multitest(8192); 228 219 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 234 } 220 221 return NULL; 222 }
Note:
See TracChangeset
for help on using the changeset viewer.