- FPU context is stored only if conflict between 2 FPU users or while
  exporting context of a process to userspace while it is the active
  user of FPU

- FPU has its owner (fpu_owner) which points to the process whose
  state is currently loaded in FPU

- the FPU exception is only turned on when scheduling a process which
  is not the owner of FPU

- FPU state is restored for the process that generated the FPU
  exception. This process runs immediately without letting scheduler
  to pick a new process to resolve the FPU conflict asap, to minimize
  the FPU thrashing and FPU exception hadler execution

- faster all non-FPU-exception kernel entries as FPU state is not
  checked nor saved

- removed MF_USED_FPU flag, only MF_FPU_INITIALIZED remains to signal
  that a process has used FPU in the past
This commit is contained in:
Tomas Hruby
2010-06-07 07:43:17 +00:00
parent b641afc78a
commit cbc9586c13
14 changed files with 87 additions and 49 deletions
+3
View File
@@ -46,6 +46,9 @@ PUBLIC int do_exec(struct proc * caller, message * m_ptr)
/* Mark fpu_regs contents as not significant, so fpu
* will be initialized, when it's used next time. */
rp->p_misc_flags &= ~MF_FPU_INITIALIZED;
/* force reloading FPU if the current process is the owner */
if (rp == fpu_owner)
release_fpu();
return(OK);
}
#endif /* USE_EXEC */