Changeset 1c1da4b in mainline
- Timestamp:
- 2012-07-16T15:38:45Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0ca7286
- Parents:
- 0cf813d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified kernel/test/synch/rcu1.c ¶
r0cf813d r1c1da4b 50 50 } exited_t; 51 51 52 /* Callback raced with preexisting readers. */ 52 53 #define ERACE 123 54 /* Waited for too long for the callback to exit; consider it lost. */ 53 55 #define ECBLOST 432 54 56 … … 85 87 86 88 if(thread[k]) { 87 /* Try to distribute evenly but allow migration. */88 thread [k]->cpu = &cpus[k % config.cpu_active];89 /* Distribute evenly. */ 90 thread_wire(thread[k], &cpus[k % config.cpu_active]); 89 91 thread_ready(thread[k]); 90 92 } … … 208 210 209 211 for (volatile size_t k = 0; k < nop_iters; ++k) { 210 / / nop, but increment volatile k212 /* nop, but increment volatile k */ 211 213 } 212 214 … … 338 340 join_one(); 339 341 340 TPRINTF("\nJoined one-cb reader, wait for c b.\n");342 TPRINTF("\nJoined one-cb reader, wait for callback.\n"); 341 343 size_t loop_cnt = 0; 342 size_t max_loops = 4; /* 200 ms */344 size_t max_loops = 4; /* 200 ms total */ 343 345 344 346 while (!one_cb_is_done && loop_cnt < max_loops) { … … 526 528 527 529 int result = EOK; 528 wait_for_cb_exit(2 , p, &result);530 wait_for_cb_exit(2 /* secs */, p, &result); 529 531 530 532 if (result != EOK) { … … 689 691 join_one(); 690 692 693 /* Wait at most 4 secs. */ 691 694 wait_for_cb_exit(4, &p->e, &p->result); 692 695 … … 703 706 static bool do_reader_preempt(void) 704 707 { 705 TPRINTF("\nReader preempts; after GP start, before GP, twice before GP\n");708 TPRINTF("\nReaders will be preempted.\n"); 706 709 707 710 bool success = true; … … 744 747 rcu_read_lock(); 745 748 746 /* Contain synch accessing after reader section beginning. */749 /* Order accesses of synch after the reader section begins. */ 747 750 memory_barrier(); 748 751 … … 750 753 751 754 while (!synch->synch_running) { 752 /* 0.5 sec */755 /* 0.5 sec */ 753 756 delay(500 * 1000); 754 757 } … … 829 832 { 830 833 /* 5 us * 1000 * 1000 iters == 5 sec per updater thread */ 831 /*delay(5);*/834 delay(5); 832 835 free(item); 833 836 } … … 847 850 } 848 851 849 /* Print a dot if we make progress of 1% */850 if (s->master && 0 == (i % (s->iters/100 + 1)))852 /* Print a dot if we make a progress of 1% */ 853 if (s->master && 0 == (i % (s->iters/100))) 851 854 TPRINTF("."); 852 855 } … … 855 858 static bool do_stress(void) 856 859 { 857 //size_t cb_per_thread = 1000 * 1000;858 860 size_t cb_per_thread = 1000 * 1000; 859 861 bool done = false; … … 861 863 stress_t worker = { .iters = cb_per_thread, .master = false }; 862 864 863 size_t thread_cnt = min(MAX_THREADS , config.cpu_active);865 size_t thread_cnt = min(MAX_THREADS / 2, config.cpu_active); 864 866 /* Each cpu has one reader and one updater. */ 865 867 size_t reader_cnt = thread_cnt; … … 873 875 bin_order_suffix(max_used_mem, &mem_units, &mem_suffix, false); 874 876 875 TPRINTF("\nStress: Run %zu nop-readers and %zu updaters. %zu callbacks 877 TPRINTF("\nStress: Run %zu nop-readers and %zu updaters. %zu callbacks" 876 878 " total (max %" PRIu64 " %s used). Be very patient.\n", 877 879 reader_cnt, updater_cnt, exp_upd_calls, mem_units, mem_suffix); … … 914 916 --e->count_down; 915 917 916 if (0 == (e->count_down % (e->total_cnt/100 + 1))) {918 if (0 == (e->count_down % (e->total_cnt/100))) { 917 919 TPRINTF("*"); 918 920 }
Note:
See TracChangeset
for help on using the changeset viewer.