提交 4558fe33 创建 作者: Silas Boyd-Wickizer's avatar Silas Boyd-Wickizer

Merge branch 'scale-amd64' of git+ssh://amsterdam.csail.mit.edu/home/am0/6.828/xv6 into scale-amd64

...@@ -11,6 +11,7 @@ enum { verbose = 0 }; ...@@ -11,6 +11,7 @@ enum { verbose = 0 };
enum { npg = 1 }; enum { npg = 1 };
static pthread_barrier_t bar; static pthread_barrier_t bar;
static pthread_barrier_t bar2;
#define NITER 10 // 1000000 #define NITER 10 // 1000000
void* void*
...@@ -25,6 +26,8 @@ thr(void *arg) ...@@ -25,6 +26,8 @@ thr(void *arg)
if (tid == 0) if (tid == 0)
mtenable_type(mtrace_record_ascope, "xv6-asharing"); mtenable_type(mtrace_record_ascope, "xv6-asharing");
pthread_barrier_wait(&bar2);
for (int i = 0; i < NITER; i++) { for (int i = 0; i < NITER; i++) {
if (verbose && ((i % 100) == 0)) if (verbose && ((i % 100) == 0))
fprintf(1, "%d: %d ops\n", tid, i); fprintf(1, "%d: %d ops\n", tid, i);
...@@ -60,6 +63,7 @@ main(int ac, char **av) ...@@ -60,6 +63,7 @@ main(int ac, char **av)
// fprintf(1, "mapbench[%d]: start esp %x, nthread=%d\n", getpid(), rrsp(), nthread); // fprintf(1, "mapbench[%d]: start esp %x, nthread=%d\n", getpid(), rrsp(), nthread);
pthread_barrier_init(&bar, 0, nthread); pthread_barrier_init(&bar, 0, nthread);
pthread_barrier_init(&bar2, 0, nthread);
for(u64 i = 0; i < nthread; i++) { for(u64 i = 0; i < nthread; i++) {
pthread_t tid; pthread_t tid;
......
...@@ -11,7 +11,6 @@ extern atomic<u64> tlbflush_req; ...@@ -11,7 +11,6 @@ extern atomic<u64> tlbflush_req;
// Per-CPU state // Per-CPU state
struct cpu { struct cpu {
cpuid_t id; // Index into cpus[] below cpuid_t id; // Index into cpus[] below
hwid_t hwid; // Local APIC ID
int ncli; // Depth of pushcli nesting. int ncli; // Depth of pushcli nesting.
int intena; // Were interrupts enabled before pushcli? int intena; // Were interrupts enabled before pushcli?
struct segdesc gdt[NSEGS]; // x86 global descriptor table struct segdesc gdt[NSEGS]; // x86 global descriptor table
...@@ -22,6 +21,8 @@ struct cpu { ...@@ -22,6 +21,8 @@ struct cpu {
atomic<u64> tlbflush_done; // last tlb flush req done on this cpu atomic<u64> tlbflush_done; // last tlb flush req done on this cpu
struct proc *prev; // The previously-running process struct proc *prev; // The previously-running process
hwid_t hwid __mpalign__; // Local APIC ID, accessed by other CPUs
// Cpu-local storage variables; see below // Cpu-local storage variables; see below
struct cpu *cpu; struct cpu *cpu;
struct proc *proc; // The currently-running process. struct proc *proc; // The currently-running process.
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论