Lazy FPU
- 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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user