提交 f58d6070 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

push finishproc() to the core that last executed the process,

rather than the core that initially called exec.
上级 f47148e1
...@@ -80,6 +80,7 @@ struct proc : public rcu_freed { ...@@ -80,6 +80,7 @@ struct proc : public rcu_freed {
u64 user_fs_; u64 user_fs_;
u64 unmap_tlbreq_; u64 unmap_tlbreq_;
int exec_cpuid_; int exec_cpuid_;
int run_cpuid_;
int in_exec_; int in_exec_;
int uaccess_; int uaccess_;
......
...@@ -175,6 +175,8 @@ exec(const char *path, char **argv, void *ascopev) ...@@ -175,6 +175,8 @@ exec(const char *path, char **argv, void *ascopev)
myproc()->in_exec_ = 0; myproc()->in_exec_ = 0;
ascope->open("sys_exec2(%s)", path); ascope->open("sys_exec2(%s)", path);
myproc()->run_cpuid_ = mycpuid();
if((ip = namei(myproc()->cwd, path)) == 0) if((ip = namei(myproc()->cwd, path)) == 0)
return -1; return -1;
......
...@@ -370,6 +370,7 @@ fork(int flags) ...@@ -370,6 +370,7 @@ fork(int flags)
*np->tf = *myproc()->tf; *np->tf = *myproc()->tf;
np->cpu_pin = myproc()->cpu_pin; np->cpu_pin = myproc()->cpu_pin;
np->exec_cpuid_ = myproc()->exec_cpuid_; np->exec_cpuid_ = myproc()->exec_cpuid_;
np->run_cpuid_ = myproc()->run_cpuid_;
// Clear %eax so that fork returns 0 in the child. // Clear %eax so that fork returns 0 in the child.
np->tf->rax = 0; np->tf->rax = 0;
...@@ -442,7 +443,7 @@ wait(void) ...@@ -442,7 +443,7 @@ wait(void)
assert(w); assert(w);
w->rip = (void*) finishproc; w->rip = (void*) finishproc;
w->arg0 = p; w->arg0 = p;
assert(wq_pushto(w, p->exec_cpuid_) >= 0); assert(wq_pushto(w, p->run_cpuid_) >= 0);
if (!xnspid->remove(pid, &p)) if (!xnspid->remove(pid, &p))
panic("wait: ns_remove"); panic("wait: ns_remove");
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论